-
Notifications
You must be signed in to change notification settings - Fork 766
[Android] Opening app from the notification when app is dead not working correctly #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If anyone has the same issue, a fix might be adding this to your
After adding this, if a notification was received while app was killed / in a dead state, when we launch the app |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
@llostris I have same problem with
|
@jsina |
@llostris the app is compiled but the
and here is
|
Dear @llostris protected void onCreate(Bundle savedInstanceState) {
// Use SplashTheme in AndroidManifest.xml for MainActivity, themes loads before layouts inflate
setTheme(R.style.AppTheme); // Now set the theme from Splash to App before setContentView
setContentView(R.layout.launch_screen); // Then inflate the new view
SplashScreen.show(this); // Now show the splash screen. Hide it later in JS
super.onCreate(savedInstanceState);
} Where should I add this ? Bundle notificationData = getIntent().getExtras();
if (notificationData != null) {
final IPushNotification notification = PushNotification.get(getApplicationContext(), notificationData);
if (notification != null) {
notification.onOpened();
}
} "react-native": "0.62.2",
"@react-native-firebase/app": "^7.1.0",
"@react-native-firebase/messaging": "^7.1.1", |
@ghasemikasra39 In our app, we've simply added it add the end, so after
However, note that this was resolving the problem for |
We've just upgraded to the latest version of the library, and we've run into an issue when opening the app from notification - if the app is "dead" (not running in the background), and the user clicks on the notification, the
PendingNotifications.getInitialNotification()
is not triggered at all. We used that to navigate to a specific place in the app using some data passed in the notification, but now it's not working.After some digging I've found this is related to the FCM implementation, and (most likely) the fact that we send both data and notification in the body of the notification. When opening the app from the notification in this case (when app is "dead"), data is meant to be passed as extras to the opening Intent, which seems to not be picked up as initial notification here.
How can we handle this situation?
react-native-notification version we're using: 1.3.0
The text was updated successfully, but these errors were encountered: