12

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.

StephenFeather
  • 913
  • 11
  • 13
fahad86
  • 159
  • 1
  • 1
  • 8
  • Possible duplicate of [Xcode 8 "the aps-environment entitlement is missing from the app's signature" on submit](http://stackoverflow.com/questions/39554177/xcode-8-the-aps-environment-entitlement-is-missing-from-the-apps-signature-on) – Aliaksandr Bialiauski Oct 03 '16 at 05:48
  • 1
    Alexander, the other question deals with iOS projects built within xcode, appcelerator titanium apps are not built within that environment, so this may be similar, but the solutions are not the same. – StephenFeather Nov 17 '16 at 11:50

3 Answers3

18

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.

StephenFeather
  • 913
  • 11
  • 13
  • 5.5.1 did not solve the issue but adding the Entitlements.plist did.. Thanks again @StephenFeather – fahad86 Sep 20 '16 at 14:05
  • don't forget to add the filename of the entitlements file to the "Code Signing Entitlements" key (CODE_SIGN_ENTITLEMENTS) (Target > Build Settings) – thijsonline Oct 06 '16 at 11:57
  • Actually, within the titanium eco system, you don't need to be fiddling with the xcode project. – StephenFeather Oct 06 '16 at 14:25
  • Note you should probably just leave this as development. It is set to production automatically either when archiving or when uploading to iTunes Connect. – Montdidier Oct 27 '16 at 01:44
2

This answer linked below is a little easier than the solutions suggested here. You can simply fix using the xCode UI without having to manually create any new files. Just flip the switch for push notifications in the Capabilities section.

https://stackoverflow.com/a/39420213/4076298

Community
  • 1
  • 1
scosman
  • 2,343
  • 18
  • 34
  • 1
    Actually, again, this is a Titanium environment question, and your solution does not apply in this environment. The user would need to adjust settings within the generated project file following every clean build. – StephenFeather Nov 17 '16 at 11:47
  • 1
    @StephenFeather there's no mention of that in the title or body of the question. You edited it yesterday to remove "Xcode" from and tags (and it's still in the title). Kinda lame to change the question then complain about answers. – scosman Nov 19 '16 at 13:58
  • If you believe its an xcode question, edit it back. But that would remain in conflict with the original posters titanium and appcelerator tags. Your solution still does NOT solve the original poster's problem regardless of your feelings regarding the edits. – StephenFeather Nov 19 '16 at 15:57
  • @StephenFeather my solution works fine, and is easier (it uses the UI makes the same change to the plist). The title and tags explicitly said it's xCode question (until you edited it). Kinda lame man... – scosman Nov 21 '16 at 04:28
0

Appcelerator have actually fixed this issue in an upcoming release 5.5.1 and can be downloaded from here: http://builds.appcelerator.com.s3.amazonaws.com/index.html#5_5_X

fahad86
  • 159
  • 1
  • 1
  • 8