LoginSignup
55
54

More than 5 years have passed since last update.

【iOS】Missing Push Notification Entitlement 対処方法

Posted at

プッシュ通知を実装して、申請したところ、以下のような通知がきた

Missing Push Notification Entitlement - Your app appears to include API used to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.

If you would like to update your binary for this app, you can reject this binary from the Binary Details page in iTunes Connect. Note that rejecting your binary will remove your app from the review queue and the review process will start over from the beginning when you resubmit your binary.

要約すると、
アプリにはプッシュ通知の機能が含まれているようですが、署名にはプッシュ通知の資格が含まれていません。プロビジョニングポータルでアプリケーションIDのプッシュ通知をオンにして、プッシュ通知権限のある証明書を設定してね。ということらしいです。

色々やってみた結果、証明書を作り直すことで回避出来ました。
申請までに行ったことは、

  • リリース後の改修で、プッシュ通知機能を実装
  • プロビジョニングポータルの該当アプリケーションIDのプッシュ通知をオンにする
  • APNs証明書を作って、mBaasに設定
  • テストでプッシュ通知使えたので、リリース用のAPNs証明書作成&設定して、申請

今回、アプリケーションIDのプッシュ通知をオンにした後、証明書を再作成していなかったので、プッシュ通知の権限が反映されなかった模様

きちんと反映されたどうかは、Provisioning Profileの情報を見ればわかります。

<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>prefix.BundleID</string>
    <key>aps-environment</key> --> これが入ってればOK
    <string>production</string>
    <key>com.apple.developer.team-identifier</key>
    <string>prefix</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>prefix.BundleID</string>
    </array>
</dict>
</plist>

5行目の<key>aps-environment</key> が入ってればOKです。

  • Provisioning Profileの確認方法
    • Xcodeの[Window] - [Organizer] - [Archives] - [Distribute] を選択
    • 「Save for Enterprize ・・・」を選択しNext
    • App store公開用のProvisioning Profileを選択しExport
    • パッケージファイル(.ipa)保存先を指定しSave
    • ターミナルで解凍コマンド実行「unzip <パッケージ.ipa>」  ※Payload/フォルダに展開される
    • ターミナルで署名状況を確認するコマンド実行  「codesign -d --entitlements :- Payload/<パッケージ.app>」

参考:[エラー]Missing Push Notification Entitlement

何か間違いやアドバイスがございましたら、コメントお願いいたします。

55
54
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
55
54