evollu / evollu/react-native-fcm
when app is in background i received notification when i click on notification i am trying to show alert which is not working
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 661
- PR merge metrics
- No merged PRs in 30d
Description
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 });
}
else {
EmailPrefrences.showLocalNotification(notif);
}
});**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.