Open madhududdukuri opened 6 years ago
i am using react-native-fcm version is13.3.1 Android7.0 -motog4 Application is in background when my application is in background iam sending notification through fcm console i received notification. but when i click on notification banner it is redirecting to application but it is not able to show the alert in my application but when i debug the app its showing // present local notification code FCM.presentLocalNotification({ title: notifcationTitle, body: message, priority: 'high', show_in_foreground: true, sound: 'default', click_action: 'com.cmtventra.MainActivity', action: 'android.intent.action.MAIN', }); } //on notification received
**this.notificationListner = FCM.on(FCMEvent.Notification, async(notif) => { if (notif.opened_from_tray) { Alert.alert(notif.title, notif.body, [ { text: 'OK' }, ], { cancelable: false });
}
else {
EmailPrefrences.showLocalNotification(notif);
}
});**
try set a timeout around the alert. check the example project, it shows alert when user tap notification
i am using react-native-fcm version is13.3.1 Android7.0 -motog4 Application is in background when my application is in background iam sending notification through fcm console i received notification. but when i click on notification banner it is redirecting to application but it is not able to show the alert in my application but when i debug the app the alert is showing // present local notification code FCM.presentLocalNotification({ title: notifcationTitle, body: message, priority: 'high', show_in_foreground: true, sound: 'default', click_action: 'com.cmtventra.MainActivity', action: 'android.intent.action.MAIN', }); } //on notification received
**this.notificationListner = FCM.on(FCMEvent.Notification, async(notif) => { if (notif.opened_from_tray) { Alert.alert(notif.title, notif.body, [ { text: 'OK' }, ], { cancelable: false });