これはApple docsのものです。
When you send this message, the device initiates the registration process with Apple Push Service. If it succeeds, the application delegate receives a device token in the application:didRegisterForRemoteNotificationsWithDeviceToken: method; if registration doesn’t succeed, the delegate is informed via the application:didFailToRegisterForRemoteNotificationsWithError: method. If the application delegate receives a device token, it should connect with its provider and pass it the token.
と
The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.
私は何を観察しているが正常だと思います。 application:didRegisterForRemoteNotificationsWithDeviceToken
は、ユーザーが許可を与えた場合にのみ呼び出されるという言及はありません。 NSUserDefaultsのデバイストークンをキャッシュして、このメソッドで新しいトークンがキャッシュされたトークンと等しくないかどうかをチェックすることで最適化できると思います。
出典
2013-03-20 16:42:10
msk
あなたの主な質問についてはわかりませんが、ノートの場合は正常です。同じデバイス上のすべてのアプリケーションが同じデバイストークンを取得します。 – Eran
プッシュ通知を受け取るために既にそのアプリを許可していることがあります。設定 - >通知でアプリを検索し、アプリが既に存在するかどうかを確認します。 – msk
@MSK - すでに許可している場合は、プッシュ通知を許可するかどうかをユーザーに尋ねるシステムプロンプトを表示してはいけません。私はそこに間違っていますか? –