diff --git a/bgMessaging.js b/bgMessaging.js index 60b98b2..3b1362f 100644 --- a/bgMessaging.js +++ b/bgMessaging.js @@ -1,17 +1,17 @@ //@flow import { NativeModules, AppState } from 'react-native'; import Logger from './Logger'; const { SylkNative } = NativeModules; const logger = new Logger('bgMessaging'); export default async (remoteMessage) => { - logger.debug("Data notification received in state " + AppState.currentState, remoteMessage, SylkNative); - - if(AppState.currentState == "background" && remoteMessage.data.event === 'incoming_session') { + console.log("Data notification received in state ", AppState.currentState, remoteMessage, SylkNative); + if(AppState.currentState == "background" && (remoteMessage.data.event === 'incoming_session' || remoteMessage.data.event === 'incoming_conference_request')) { //rnn_hasRNHost indicates if the app has a react native host when the notification was received. This is used to determine if the app was in the background or dead. If it was dead then launch the main activity to wake enough of the phone to be useful. + console.log('Wake up from push'); SylkNative.launchMainActivity(); } return Promise.resolve(); } \ No newline at end of file