registerForRemoteNotificationsの呼び出し後、appDelegateメソッドdidRegisterForRemoteNotificationsWithDeviceTokenが呼び出されません。プッシュ通知を受け取ることができないため、私はAPNからトークンを受け取っていません。IOS 11 didRegisterForRemoteNotificationsWithDeviceTokenが呼び出されていない
「許可」ポップアップが表示されますが、allowを選択した後、didRegisterForRemoteNotificationsWithDeviceTokenからの通常の応答は得られません。前IOS 11.
に働くために使用
すべてが同じ問題を経験して誰ですか?私の問題について多くの苦情はないようです。
IOS11では、APNの登録プロセスに関して何か変更されましたか? また、アプリケーションがバックグラウンドで実行されているときにIOS 10のdidReceiveRemoteNotificationが機能していません。
アイブ氏は、修正のためのハイとローの検索が、プッシュ通知はちょうどIOS 11.私はすべてのInfo.plistデータが正しく設定されている
ため、現時点では私のために分割されます。 プロジェクト設定ですべてのスイッチを設定しました。 私は以前のバージョンのアプリをテストしました。 私は素人骨のプロジェクトを作成しましたが、それは私たちのプロダクションアプリと同じように動作しません。 登録コードがIOS 10と同じであると仮定しています。
SOSしてください!おかげさまで
if(SYSTEM_VERSION_LESS_THAN(@"10.0"))
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
if(optind != nil)
{
NSLog(@"registerForPushWithOptions:");
}
}
else
{
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error)
{
if(!error)
{
[[UIApplication sharedApplication] registerForRemoteNotifications]; // required to get the app to do anything at all about push notifications
NSLog(@"Push registration success.");
}
else
{
NSLog(@"Push registration FAILED");
NSLog(@"ERROR: %@ - %@", error.localizedFailureReason, error.localizedDescription);
NSLog(@"SUGGESTIONS: %@ - %@", error.localizedRecoveryOptions, error.localizedRecoverySuggestion);
}
}];
}
そして次framework
追加 - - あなたがコードを使用する必要がdidFinishLaunchingWithOptions
AppDelegate
クラスメソッドで