APNs is used in the application with the deployment target set to 8.0. In my application I need to perform some operations in order to determine whether to generate local notification and show it to the user on that moment or not.
When the payload is sent to APNs to generate push notification, application receives push notification whether its in Background or Foreground state and following method gets called.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
Where app generates a local notification.
The problem is that when the application is Terminated/Closed completely/Does not appear in tabs, app does not receive push notification.
- Development certificates are fine because its working in Background/Foreground state.
- Background Mode in
CapabilitiesisONwithBackground Fetch,Remote notificationschecked Push NotificationsisONinCapabilities- The Payload contains
apswhich contains"content-avilable" : 1and other data. - The Payload does not contain
alert,badgeorsoundparameters
Another confusion here is that I have tried using the auto generated notification way too. Where payload contains alert, badge and sound which generates a auto generated push notification even if the application is terminated.
Other applications like WhatsApp and GMail generates notification while the app is terminated.
So the question is how to implement this feature in my application?