Reputation: 662
Reading from Apple's documentation about Push Notifications:
application:didFinishLaunchingWithOptions:
method application:didReceiveRemoteNotification:
method So my question is which delegate gets called if the application is in background state (it is running or it's suspended)? Is it application:didFinishLaunchingWithOptions:
or application:didReceiveRemoteNotification:
?
Please help me, thank you!
Upvotes: 9
Views: 10262
Reputation: 505
application:didReceiveRemoteNotification:
is called when your app is in the background + the message alert still active.
Once the message alert is inactive then the application will not receive any event. Do correct me if I'm wrong.
Upvotes: 1
Reputation: 16337
application:didReceiveRemoteNotification:
is called when your app is in the background. This question has an answer which tells you how to tell if your app was in the background or not.
Upvotes: 7