Tapping a notification in the notification centre can result in app being relaunched!
See original GitHub issueTo reproduce:
-
Send an Android notification that does not contain a
data
element while the app is running in the background. -
Tap on the notification in the notification centre.
-
Repeat a few times.
What I noticed is that when tapping the notification my app appeared to re-launch itself even though it was already running. After trying a couple of times I realised that the app was launching multiple copies of itself - each tap resulted in a new instance of the JS app… but only 1 runtime - so I have multiple apps running side by side with a single UI!
It does not appear to happen if the push notification contains a data
element.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Use notifications on your iPhone or iPad - Apple Support (CA)
Tap a single notification to open the app that it's from. Tap a group of notifications to view all recent notifications from that...
Read more >Change notification settings on Apple Watch
To have the app once again notify you immediately, open the Settings app on your iPhone, tap Notifications, tap the app, then tap...
Read more >Handling Notifications and Notification-Related Actions
Tapping one of the buttons forwards the selected action to your app, without bringing the app to the foreground. If your app supports...
Read more >View and respond to notifications on iPhone - Apple Support
To see and hear these notifications again, swipe left on the notification in Notification Center, tap Options, then tap Unmute. Turn off notifications...
Read more >Notifications - System experiences - Human Interface Guidelines
A notification gives people timely, high-value information they can understand at a glance.
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 Free
Top 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
@npomfret @mikelambert thanks for your answers. I fixed my problems with an attribute in my AndroidManifest.xml. I added
android:launchMode="singleTop"
to the main activity element.Maybe this helps s.b. else!
The deep linking docs recommend
"singleTask"
- https://facebook.github.io/react-native/docs/linking.html -I havent tried the push notification module yet. But does anyone know how that compares to with @jk94 approach above of
android:launchMode="singleTop"
?