0
votes

In the application active state, the didReceiveRemoteNotification method is called and when the application is in the background and inactive state the didReceiveRemoteNotification method is not called.

Code:-

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void){

    NSLog("Push Received: \(userInfo)")
    completionHandler(UIBackgroundFetchResult.newData)

}

1
what is the reason you are expecting didReceiveRemoteNotification to be called in background?Gokul G

1 Answers

0
votes

If it calms you down, I had the same problem and I did nothing to fix this, because after a few hours my application started to receive notification in the background. But if it doesn't help, you should try sending notifications manually using ARC, and check notification status.