アプリケーションにプッシュ通知データを保存したいですが、ユーザーがマルチタスクビューアでアプリケーションをスワイプしてアプリケーションを終了した場合、データを保存できません。状態).Iは、アプリケーションを使用:didReceiveRemoteNotification:fetchCompletionHandler:まだ私はこのアプリケーション:didReceiveRemoteNotification:fetchCompletionHandler:iOS 9が呼び出されていない
などのアプリの設定を設定しているプッシュ通知データにを保存することができませんでしたit.Butを処理するために、
とペイロード、
{
"aps" : {
"alert" = "Notification with custom payload",
},
"content-available" = 1
}
とアプリケーション:didReceiveRemoteNotification:fetchCompletionHandlerは:これは完全に正常であるこの
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
if(application.applicationState == UIApplicationStateInactive) {
NSLog(@"Inactive");
//Show the view with the content of the push
completionHandler(UIBackgroundFetchResultNewData);
} else if (application.applicationState == UIApplicationStateBackground) {
NSLog(@"Background");
NSString *info = [[userInfo valueForKey:@"aps"]valueForKey:@"alert"];
completionHandler(UIBackgroundFetchResultNewData);
} else {
NSLog(@"Active");
//Show an in-app banner
completionHandler(UIBackgroundFetchResultNewData);
}
}
@Ewan Mellor、@ Anbu.Karthik .Ok。教えてください。アプリが停止状態のときにプッシュ通知データを保存する方法はありますか? – PramukaD