Post iOS10 / Xcode 8.0 "Missing Push Notification Entitlement" 构建 iTunes Store 后出错

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

在构建 iTunes 商店并提交存档时,我从 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

我们尝试按照论坛中的建议重新创建配置文件,但我们仍然收到相同的电子邮件。

在 "Capabilities" 选项卡下打开构建的 .xcodeproj 时,推送通知设置似乎已关闭。

尝试在项目的根目录中创建一个 Entitlements.plist 文件。

<?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,在 Xcode 8 之前,Xcode 会读取您的配置文件,如果配置文件中设置了推送授权,则会自动为您将授权添加到构建中。从 Xcode 8 开始,情况不再如此,您必须明确指定您使用的权利。

Appcelerator 实际上已经在即将发布的 5.5.1 版本中解决了这个问题,可以从这里下载:http://builds.appcelerator.com.s3.amazonaws.com/index.html#5_5_X

下面链接的答案比此处建议的解决方案要简单一些。您可以简单地使用 xCode UI 进行修复,而无需手动创建任何新文件。只需在“功能”部分中拨动推送通知开关即可。