Can I get a list of push notifications (APNS notifications) for my application when the application has switched from background to foreground mode?
No. There is no list. You can receive only one notification at a time. When iPhone users are disconnected and you send 5 notifications, the user will receive only the last one you send.
If the user starts your application using the open action in the notification, you will receive it at startup using:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Another thing
My application receives a push notification when the application is in the background. After that, I click the application icon and I want to receive information about the notification received. How can I get this information?
You can not. When the user closes the notification and opens the application later, he has already left and there is no access to it.
When sending push notifications, you probably have access to the server via the Internet, where you register the user's devices.
The usual way to deal with this is to save notifications on this server and request it when the application starts ... so use the notification to notify the user about the launch of your application, and then check your server when the application starts for anything you want.
source share