ユーザーが「許可しない」ボタンをタップしたときにデバイストークンを取得するのが少し難しかった。プッシュ通知の「許可しない」ボタンをタップしたときのデバイストークンの取得
「OK」ボタンをタップするとデバイストークンしか取得できません。 - 私はこの1
で何の問題もない。ここUIApplication.h
[application registerForRemoteNotifications];
// Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate.
Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
からノートがありますか?この注記は、「許可しない」ボタンを選択すると、デバイストークンを取得できないことを意味しますか?
ユーザーが通知を拒否している場合、なぜ必要なのでしょうか? – Caleb
アプリが起動するたびに通知の登録を試行する必要があります。その後、ユーザが設定であなたのアプリの通知を許可した場合、あなたは 'didRegisterForRemoteNotifications'の電話を受けるでしょう – Paulw11
あなたのアプリが' APNS'サービスで有効になっている場合、 'APNS'の' Apple guideline'に従って、あなたが 'トークン 'を得ることができないよりも許可したいと思っている場合に通知を有効にするかどうか、また将来的に許可する場合は、設定から有効にしたいと考えています。 Ref Link:https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1 – CodeChanger