Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Push Notification - How to get the notification data when you click on the app icon instead of notification

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.)

like image 314
Howard Avatar asked Aug 23 '12 02:08

Howard


People also ask

How do I get notification details on my iPhone?

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.

What is in app notification vs push notification?

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.

How do I see all push notifications?

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.


1 Answers

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.

like image 129
fannheyward Avatar answered Oct 13 '22 21:10

fannheyward