application:didReceiveRemoteNotification:fetchCompletionHandler Not Called

后端 未结 8 1397
南方客
南方客 2020-12-01 08:22

It appears the function application:didReceiveRemoteNotification:fetchCompletionHandler is not called when the app has been forcefully quit. It was my impressio

8条回答
  •  情话喂你
    2020-12-01 08:23

    The app should be launched even if it is not running. The Apple documentation says:

    When this value is present and a push notification arrives on a device, the system sends the notification to your app (launching it if needed) and gives it a few moments to process > the notification before displaying anything to the user. (iOS App Programming Guide)

    When a push notification arrives, the system displays the notification to the user and launches the app in the background (if needed) so that it can call this method. (UIApplicationDelegate Protocol Reference)

    Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running, the system calls this method regardless of the state of your app. If your app is suspended or not running, the system wakes up or launches your app and puts it into the background running state before calling the method. (UIApplicationDelegate Protocol Reference)

    However when testing with "content-available":1 pushes the app is never launched when it is not running. When the app is suspended it works.

    Did you find yourself a solution Wes?

提交回复
热议问题