Similar to this question: How do I access remote push notification data on applicationDidBecomeActive?
But the different is how can you access the notification data when you are inapplicationDidBecomeActive
and if you have clicked on the app icon instead of the push notification.
The flow is: If you click on the push notification
then didReceiveRemoteNotification
will be triggered, but if you click on the original app icon, only applicationDidBecomeActive
will be triggered and didReceiveRemoteNotification
will not be called.
I am looking for the later case so how can I access the push notification data.
(Both case assuming the app is in background and not killed yet.)
Tap on “Notifications.” Select “Show Previews” at the top. Tap on “Always.” From now on, whenever you receive a notification, it will always show the preview of the content whether your iPhone is locked or unlocked—no need to verify with Face ID first.
Push notifications – standard mobile notifications that are used most often. These are messages that the user sees without opening the app, typically on the lock screen. In-app notifications – messages that the user gets inside the application after they have opened it.
Scroll down and long-press the “Settings” widget, then place it on your home screen. You'll get a list of features that the Settings shortcut can access. Tap “Notification Log.” Tap the widget and scroll through your past notifications.
You can't get remote push payload by launching app from homescreen.
If the push data is important for app use, load it from your server after app launched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With