ios - How to receive push notification from APNs while the app is terminated/Not working in background or foreground -


apns used in application deployment target set 8.0. in application need perform operations in order determine whether generate local notification , show user on moment or not.

when payload sent apns generate push notification, application receives push notification whether in background or foreground state , following method gets called.

- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler 

where app generates local notification.

the problem when application terminated/closed completely/does not appear in tabs, app not receive push notification.

  • development certificates fine because working in background/foreground state.
  • background mode in capabilities on background fetch, remote notifications checked
  • push notifications on in capabilities
  • the payload contains aps contains "content-avilable" : 1 , other data.
  • the payload not contain alert, badge or sound parameters

another confusion here have tried using auto generated notification way too. payload contains alert, badge , sound generates auto generated push notification if application terminated.

other applications whatsapp , gmail generates notification while app terminated.

so question how implement feature in application?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -