Does iOS cache remote notifications for apps that are running in background? -
official document apple developer network mentions payload of push notification provided application when it’s running in foreground, or when it’s activated because of push notification. cannot find statement happens when app running in background.
i did test instant message application, , found not understand. procedure of test is:
- enable push notification app
- switch app background
- send 2 ims client. 2 push notification arrives @ client , badge on app's icon becomes 2
- shut down cellular network prevent app communicating server
- click app icon switch foreground
after these steps, can see 2 messages in chat window. because app not able retrieve messages directly server, explanation push notifications processed app when it’s in background, or cached somewhere , can accessed app when it's switched foreground. ios allows app execute codes when it’s in background, or cache notifications apps?
the application caches notifications 2-5 minutes(i don't know exact) time..
if receive notification , open app in 2-5 minutes
then in app delegate
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { }
you have notification object .. can using launchoptions
object key uiapplicationlaunchoptionsremotenotificationkey
if don't open within 2-5 minutes.. there no notification object,
this based on experience..cant totally support answer
Comments
Post a Comment