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