Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch all iOS Push Notifications with different user actions including tap on app icon

As per the Apple guide:

"As a result of the presented notification, the user taps the action button of the alert or taps (or clicks) the application icon. If the action button is tapped (on a device running iOS), the system launches the application and the application calls its delegate’s application:didFinishLaunchingWithOptions: method (if implemented); it passes in the notification payload (for remote notifications) or the local-notification object (for local notifications).

If the application icon is tapped on a device running iOS, the application calls the same method, but furnishes no information about the notification . If the application icon is clicked on a computer running Mac OS X, the application calls the delegate’s applicationDidFinishLaunching: method in which the delegate can obtain the remote-notification payload."

My question is Suppose user got 3-4 Push notifications from provider and all are stored in apple's notification center. If user tapped on notification alert, he/she can easily get the notification data in the app. But if user tapped app icon on iPhone, how to get all the data related of all previous notifications.

Thanks in advance!

like image 902
Kirity Avatar asked Jul 02 '12 09:07

Kirity


People also ask

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.

How do I see multiple notifications from the same app on my iPhone?

To expand a stack of notifications on either the Lock screen or in Notification Center (swipe down from the top of the screen), tap the stack. Once you've expanded a stack, you can tap Show Less to restack it, tap the X button to remove the entire stack, or tap any individual notification to open it.

How do I see all iOS notifications?

To see your notifications in Notification Center, do any of the following: On the Lock Screen: Swipe up from the middle of the screen. On other screens: Swipe down from the top center. Then you can scroll up to see older notifications, if there are any.


1 Answers

You can't, you will only receive information about the notification that was used to open your app.

So if a user opens your app, and your app has notifications, you will not be able to retrieve them from with in your app.

A work around could be to also keep track of notification on a server and handle this with in the app. Thus the server keeps track on which notification has been read. This is how Facebook does it.

like image 166
rckoenes Avatar answered Sep 21 '22 08:09

rckoenes