application:didReceiveRemoteNotification:fetchCompletionHandler Not Called

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

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
    *)launchOptions {
    
        //Remote Notification Info
        NSDictionary * remoteNotifiInfo = [launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
    
        //Accept push notification when app is not open
        if (remoteNotifiInfo) {
           [self application:application didReceiveRemoteNotification: remoteNotifiInfo];
        }
    
        return YES;
    }
    

提交回复
热议问题