application:didReceiveRemoteNotification:fetchCompletionHandler Not Called

后端 未结 8 1374
南方客
南方客 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:48

    As documented by Apple, the new multitasking API (fetch and remote-notification) will work only when the app in the suspended/background/foreground state.

    • In the background/foreground state, then application:didReceiveRemoteNotification:fetchCompletionHandler will get triggered.

    • In the Suspended state, then -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions will get triggered.

    • In the Not Running state (your case), application:didReceiveRemoteNotification:fetchCompletionHandler never gets triggered.

    Please refer to the Apple documentation for more about app states.

提交回复
热议问题