Post iOS10 / Xcode 8.0 "Missing Push Notification Entitlement" error after build for iTunes Store

fahad86 picture fahad86 · Sep 20, 2016 · Viewed 7.9k times · Source

Whilst building for iTunes store and submitting the archive, I receive this error from apple:

Dear developer,

We have discovered one or more issues with your recent delivery for "XXXXXXXXX". Your delivery was successful, but you may wish to correct the following issues in your next delivery:

Missing Push Notification Entitlement - Your app includes an API for Apple's Push Notification service, but the aps-environment entitlement is missing from the app's signature. To resolve this, make sure your App ID is enabled for push notification in the Provisioning Portal. Then, sign your app with a distribution provisioning profile that includes the aps-environment entitlement. This will create the correct signature, and you can resubmit your app. 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.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.

Regards,

The App Store team

We tried recreating the provisioning profiles as suggested in the forums but still we keep getting the same email.

Whilst opening the built .xcodeproj under the "Capabilities" tab the push notification settings seems to be turned off.

Answer

StephenFeather picture StephenFeather · Sep 20, 2016

Try creating an Entitlements.plist file in the root of your project.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/
DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>aps-environment</key>
    <string>production</string> <!-- Either development or production -->
  </dict>
</plist>

SO, before Xcode 8, Xcode would read your provisioning profile and if the profile had the push entitlement set in it, would automagically add the entitlement to the build for you. Since Xcode 8, this is no longer the case, and you must specifically specify the entitlements you use.