raginggoat
raginggoat

Reputation: 3600

Save Push Notifications and Display in UITableView

I am wanting to implement functionality similar to the Fandango and Starbucks apps where the user gets a notification in an inbox. Ideally, if the user opens the app from the notification, it would go to the appropriate view in the app. For example, if the notification is a benefit update, and the user taps the notification, the benefits view would open.

If the app is opened by tapping the app icon and not by selecting the notification, I want the notification info to be shown in a table view. I'm guessing I could just save the notification payload dictionary to an array and use that to populate the table view. I would also want to badge the inbox in the app and the app icon with the number of notifications in the array.

I'm just not sure how to go about doing this type of functionality.

Upvotes: 1

Views: 773

Answers (1)

rckoenes
rckoenes

Reputation: 69479

You can not get the notifications in the notification screen, there is no API for it. Only when a user clicks on a notification is you app informed about the notification used to open your app.

Other apps solve this by keep track of the notifications send to the user on there server and have some API to retrieve these notifications.

Upvotes: 3

Related Questions