Question

I am new to iOS

I want to get the index of the UILocal notification on which the user pressed View.

For example if i have 5 local notification on an app how and the users opened the 3 rd one how can I display programatically all the notifications and how to check which index of which notification did the user press?

Was it helpful?

Solution

Local notifications have no concept of an index. The index is representative of the fire date. When the user opens the app from a local notification, that notification is passed as a parameter so you can access the fire date and, probably more importantly, the userInfo.

All that said, you have no way to access the list of notifications that were being displayed in notification centre. If the user cleared old notifications you can't tell. You only know about the notification that the user was actually interested in and used to open the app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top