Ios 应用程序在后台和前台时如何使用apns相关委托方法获取用户信息
通过网络搜索,我发现与apns相关的委托方法有三种Ios 应用程序在后台和前台时如何使用apns相关委托方法获取用户信息,ios,objective-c,apple-push-notifications,Ios,Objective C,Apple Push Notifications,通过网络搜索,我发现与apns相关的委托方法有三种 - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler: (void (^)(UNNotificationPresentationOptions options
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:
(void (^)(UNNotificationPresentationOptions options))completionHandler))
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler)
- (bool)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
如果我像下面那样设置背景或前景标志
- (void)applicationDidEnterBackground:(UIApplication *)application {
_resumingFromBackground = YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
_resumingFromBackground = NO;
}
当应用程序位于后台和前台时,如何使用此标志接收通知自定义数据