Push notifications are useful in sending broadcast messages to all registered receivers. To handle push notifications when arrived in your iOS application is tricky part in order to take their full advantage. Objective of this post is to explain how to handle push notifications when arrived. I assume that reader has already implemented a basic application that can receive push notifications. When push notification arrives, your application can be in
Closed state – App is killed
Running state – App is in Foreground
Suspended state – App is in Background
Lets discuses one by one how to handle them in each state
Closed state:
When Application is closed (some other app is running or phone is locked), push notification arrived and you tapped on it to open the app. Control will be given to appDelegate’s method i.e. didFinishLaunchingWithOptions: Please note that when you normally launch the app by taping its icon from your phone. didFinishLaunchingWithOptions: called first with its launchOptions==nil. In case you launch the app by clicking received[Continue reading...]Â









