You’ve implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add “remote-notification” to the list of your supported UIBackgroundModes in your Info.plist.
推送用下面这个方法时。
- (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler
遇到这个问题,在stockoverflow上找到了答案。
就是在capabilites中设置一下自己后台的模式。
stockoverflow