0.0.3 • Published 5 years ago

react-native-bring-foreground v0.0.3

Weekly downloads
13
License
MIT
Repository
-
Last release
5 years ago

react-native-bring-foreground (https://www.npmjs.com/package/react-native-bring-foreground)

this is a react-native library for launching the application when the application is in the background .

Getting started

$ npm install react-native-bring-foreground --save

Mostly automatic installation

$ react-native link react-native-bring-foreground

Manual installation

iOS

Not Available

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactlibrary.LaunchApplicationPackage; to the imports at the top of the file
  • Add new LaunchApplicationPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-bring-foreground'
    project(':react-native-bring-foreground').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-bring-foreground/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-bring-foreground')

Usage

import LaunchApplication from 'react-native-bring-foreground';
import type {RemoteMessage} from 'react-native-firebase';


//PackageName Must Be String For example "com.domain.application"
export default async (message: RemoteMessage) => {
    LaunchApplication.open(PackageName);
}