Looking on web and in many stackoverflow post i have seen that the only way to get remote push notification when the app is in background (and it is launched from icon and not from push message) is to call the server when the app is loaded and get the "last" messages.
I've made this test with instant messaging app (i dont tell the name of the app, but i think you understand):
- From another device i've sent one message to my device
- When my device has received the notification i have wait for push notification pop-up to disappear.
- At this point i have take device offline (no internet connection)
- I have then open the application and in the list the message was correctly added
So, if i'm in foreground, i can handle the notification on method didReceiveRemoteNotification.
If the app is in background i can handle the nofification in didFinishLaunchingWithOptions (if i launch it with push notification pop-up).
How it's possible to handle the notification when the application is in background and it is launched from icon and not from the push pop-Up?
Thanks
didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:). Perhaps that's what that unnamed app (let's call it WheresGap) does. - Eran