didReceiveRemoteNotification not called, iOS 10

后端 未结 8 1611
误落风尘
误落风尘 2020-11-22 08:27

In iOS 9.3, the didReceiveRemoteNotification method gets called on both of the following occasions.

1) When the push notification is received 2) When

8条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 09:23

    I had the same problem. Notification banner appeared, but -application:didReceiveRemoteNotification:fetchCompletionHandler: method was not called. The solution for me that worked was to add implementation of - application:didReceiveRemoteNotification: method and forward call to -application:didReceiveRemoteNotification:fetchCompletionHandler::

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
        [self application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:^(UIBackgroundFetchResult result){}];
    }
    

    Source.

提交回复
热议问题