The server will push a notification when the user start to follow or nego.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
when the user tap on the notification, this block will be executed, and I will get the notification info.
Currently I'm facing a problem, when there are more than 1 notification being pushed, when the user tap on the first one, then the second one won't be executed. Sometime user don't tap on the notification item in notification centre, but open the app directly, then - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
totally not executed.
Is there any way to get ALL notifications so that I can store the info into NSUserDefaults
?
Case 1:
When the app is not in memory(neither in background mode nor in foreground mode) the user has two choices
either open the app by clicking on the notification received
or open the app directly by clicking on the app icon
In these cases
is called where you can get the notification (if any) using this
Case 2:
But when the app is either in background or in foreground mode, then
is executed, so there you can fetch your data with respect to the notification received. And if in these modes also user tries to click on the notification then again
is called and there you can handle the notification data like in Case 1.
Hope this will help.