Android app is reloaded when push notification opened and onNotification is not triggered
See original GitHub issueMy react-native android app is automatic reload when open local push-notification and sometimes onNotification is not get triggered.
- when local notification show and i press the notification it reloads the whole app and onNotification is not called
- sometimes onNotification get called when componentDidmount called without opening any local-push-notification
react-native : 0.61.2 react-native-push-notification: 5.0.1
Note: In react-native 0.63 version i didn’t find this issue. in react-native 0.63 version local-push notification working fine.
here is my AndroidManifest.xml
`<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.freelancerid">
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="YOUR NOTIFICATION CHANNEL NAME"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
<!-- Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground) -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
android:value="false"/>
<!-- Change the value to false if you don't want the creation of the default channel -->
<meta-data android:name="com.dieam.reactnativepushnotification.channel_create_default"
android:value="true"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
android:exported="true">
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
`Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
push notification not working when app is closed in react ...
PushNotification.configure({ // (optional) Called when Token is generated (iOS and Android) onRegister: function (token) ...
Read more >Using Push Notifications with Firebase in an Ionic Angular App
Learn how to get Firebase Cloud Messaging working on iOS and Android in an Ionic ... for a notification when it arrives and...
Read more >React Native - Android Handle click on notification to navigate ...
I used this library https://github.com/zo0r/react-native-push-notification for remote push notification, onNotification method fired only ...
Read more >How to Setup Push Notifications In a React Native App (Android)
Since the release of Backendless 5.2.x, having only the JS-SDK is not enough to access all the Backendless features; in some cases, we...
Read more >[Solved]-Route on notification open-React Native
Coding example for the question Route on notification open-React Native. ... React Native Firebase Push Notification is not working When App is open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this worked for me…
AndroidManifest.xml
<activity android:name=".MainActivity" android:launchMode="singleTask"
Hi @MahmudHasanMenon I suggest you to search in the issues history, this has been discussed recently and it’s probably due to the splash screen activity. Best regards