0

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 Capabilities is ON with Background Fetch, Remote notifications checked
  • Push Notifications is ON in Capabilities
  • The Payload contains aps which contains "content-avilable" : 1 and other data.
  • The Payload does not contain alert, badge or sound parameters

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?

Manan Devani
  • 434
  • 3
  • 15
  • plz see this link http://stackoverflow.com/questions/36929869/push-notification-not-receiving-in-background-ios/36934771#36934771 – balkaran singh Nov 08 '16 at 11:35
  • @balkaran singh, thanks for your answer but it is not useful to me as the payload will auto generate a notification and in my application we need to manage notification locally. – Manan Devani Nov 08 '16 at 13:08

0 Answers0