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
capabilitiesonbackground fetch,remote notificationschecked push notificationsonincapabilities- the payload contains
apscontains"content-avilable" : 1, other data. - the payload not contain
alert,badgeorsoundparameters
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
Post a Comment