Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23908] Xcode 8: Builds with SDK 5.5.0 are missing APS-entitlements for push-notifications

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-09-23T19:22:26.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sRelease 5.5.1
ComponentsiOS
Labelsaps, entitlement, pushnotification, xcode8
ReporterPeter Ladis
AssigneeChris Barber
Created2016-09-14T12:36:57.000+0000
Updated2017-05-04T10:37:50.000+0000

Description

Attached are two screen shots....1. With SDK 5.3 yesterday...2. With SDK 5.5 Today Notice the IPA is identical except for the missing entitlement

Attachments

FileDateSize
Screen Shot 2016-09-14 at 8.30.56 AM.png2016-09-14T12:34:43.000+0000173201
Screen Shot 2016-09-14 at 8.31.25 AM.png2016-09-14T12:34:43.000+0000196151

Comments

  1. Gary Crook 2016-09-14

    Getting this too. Saw this on the Apple forum - note Engineer's reply: https://forums.developer.apple.com/thread/61571 _You need to add the entitlement to your entitlements file. Xcode will no longer automatically merge it from the provisioning profile. You can enable the capability in the project editor to have Xcode do this automatically._ I loaded the generated .xcodeproj into Xcode 8, did the above and then Product > Archive. After this I'm back to 5 entitlements including aps-environment production.
  2. Kai De Sutter 2016-09-14

    Having the same issue. I also cannot seem to work around it as building directly from XCode gives errors with hyperloop modules.
  3. Thomas Neerup 2016-09-14

    Same issue. But using xcode 7 instead of 8 with SDK 5.5 seems to include the APS entitlement.
  4. Hans Knöchel 2016-09-15

    As said above, it's a breaking change from Apple in Xcode 8. All that Xcode does when opening the Xcode-project and adding the capability is that it generated an entitlements file. In Titanium, you can do the same and place it in /platform/ios/<app-name>.entitlements. Example: *MyApp.entitlements*:
       <?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>development</string> <!-- Either development or production -->
       </dict>
       </plist>
       
    I would suggest an update to our [wiki-page](http://docs.appcelerator.com/platform/latest/#!/guide/Push_Notifications) and maybe do a blog-post to inform developers about the change in iOS 10 / Xcode 8. Everybody good with that? Thanks for informing us!
  5. Gary Crook 2016-09-15

    Adding the /platform/ios/<app-name>.entitlements worked for me.
  6. Jérôme Danthinne 2016-09-15

    This doesn't work for me. In my tiapp.xml, the name of my app is AVD, so I've created the AVD.entitlements file, but either in development or production, Xcode doesn't seem to catch it.
  7. Gary Crook 2016-09-15

    Tried cleaning your project before building?
  8. Jérôme Danthinne 2016-09-15

    Yes.
  9. Hans Knöchel 2016-09-15

    Can you attach your entitlements-file? And please make sure that your app has no localized name. In this case the entitlements-file needs to go into the language-specific directory.
  10. Jérôme Danthinne 2016-09-15

    Exactly as in a previous comment.
        <?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>development</string> <!-- Either development or production -->
        </dict>
        </plist>
        
  11. Hans Knöchel 2016-09-15

    Try to remove the comment, I don't think .entitlements files allow those kind of comments.
  12. Jérôme Danthinne 2016-09-15

    Nope. Removed comments, cleaned project, but still not working.
  13. Gary Crook 2016-09-15

    Is it saved as plain text? Paste it into TextEdit on Mac (Format > Make Plain Text) or Notepad on Windows, remove any empty rows, then save.
  14. Jérôme Danthinne 2016-09-16

    Still not working. I'm sticking with 5.4… :-(
  15. Gary Crook 2016-09-16

    And your platform/ios/ folder is alongside Resources, not inside it? This works for my Classic style project, not sure about an Alloy project.
  16. Jérôme Danthinne 2016-09-16

    Yes… !http://www.grincheux.be/remote/entitlements.png!
  17. Martin Williamson 2016-09-16

    Thanks for fix guys, adding the entitlements file did the trick - note the platform folder in question has actually moved else gets overwritten
         /app/platform/ios/<app-name>.entitlements
        
    For completeness, i copied the empty entitlements file from my build directory and added the entitlements
  18. Jérôme Danthinne 2016-09-16

    After checking, it seems that the file is correctly copied to the build/ directory (haven't checked that before). But Push still doesn't work… !http://www.grincheux.be/remote/entitlements_ok.png!
  19. Kai De Sutter 2016-09-16

    Same here, the entitlements file contents (aps-environment: production) were copied successful into the generated entitlements but push still doesn't work on an Adhoc installation while it did before Xcode 8.
  20. Jerod Fritz 2016-09-17

    Creating the entitlement file with Alloy at app/platform/iphone/.entitlements solved the problem for me as well
  21. Kai De Sutter 2016-09-18

    My apologies, I was using the commonjs ti-push-notification module in which the iOS check broke with iOS 10! With that fixed and the entitlements file, it works for me as well! :-)
  22. Hans Knöchel 2016-09-18

    [~kaiiserni] Good to know, thanks! [~jerodfritz] Can you test placing it in app/platform/ios/ as well? Wondering if it needs to be iphone/ or ios/ is also ok. Thanks! I just added a paragraph about using entitlements in Xcode in [our wiki](https://wiki.appcelerator.org/display/guides2/iOS+Interactive+Notifications) and will do the same for the [registerForPushNotifications docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network).
  23. Hans Knöchel 2016-09-18

    Docs PR for the first phase: https://github.com/appcelerator/titanium_mobile/pull/8393
  24. (deactived) Brian Immel 2016-09-19

    Updated content looks good. Merged PR.
  25. Jérôme Danthinne 2016-09-20

    Kai De Sutter: Good catch. I wasn't using ti-push-notification, but ti.parsepushnotifications, which has the same platform check bug with iOS10. Fixed now.
  26. Chris Barber 2016-09-22

    Ti SDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8416 Ti SDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/8417 Ti SDK 5_5_X PR: https://github.com/appcelerator/titanium_mobile/pull/8418
  27. Eric Wieber 2016-09-27

    Verified fixed, using: MacOS 10.12 (16A323) Studio 4.7.1.201609100950 Ti SDK 5.5.1.v20160927053850 Appc NPM 4.2.7 Appc CLI 5.5.1-1 Alloy 1.9.2 Xcode 8.0 (8A218a) App using push correctly has the aps entitlement when trying to submit to the app store. Tested by creating a project that can successfully receive push notifications, then packaging and submitting it for the app store. aps-environment was correctly shown under Binary and Entitlements
  28. Shawn Lan 2016-10-05

    With SDK 5.5.1 I don't have to fix anything manually, right?
  29. Chris Barber 2016-10-05

    [~shawnlan] Correct!
  30. Hani Hamadeh 2016-10-26

    I spent a whole hour struggling with aps entitlements in one of my apps with Titanium 5.5.1. At the end I found that the issue was related to the entitlement file I added as suggested for Facebook login on Simulator. Turns out that Appcelerator Studio copies this file (missing aps entitlements) inside the project to overwrite the one generated by Xcode.http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook
  31. Hans Knöchel 2016-11-12

    Hey [~hini], here to help! So when creating a custom entitlements-file, it overwrites the generated one containing the aps-environment? That's clearly an issue and I will file an own ticket for this use-case. In the mean-time, is there a workaround to use both, e.g. placing the entitlements in the section of the tiapp.xml? At least I would suggest to copy the content of the generated entitlements to your local one and go with that one for now until we fix this. Thx!
  32. Yahya Uddin 2017-05-03

    If this issue is closed can we update the following doc: http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Interactive_Notifications-section-src-40930452_iOSInteractiveNotifications-SendanInteractivePushNotification where it mentions: {quote} In Xcode 8 and later, you need to add the push capabilities to your application manually, since Xcode does not reference them from the provisioning profile automatically any more. To do so, you need to create an entitlements file called .entitlements, where should be replaced with the app-name used in your tiapp.xml. When using Alloy, the file needs to be created in app/platform/iphone/ and in platform/ios/ when using a classic project. The content of that file should look like this: [some code] Please note that you either need to specify development for device-builds or production for distribution builds on the App Store. We are working on automating that process, so the developer does not need to do additional steps. Please follow TIMOB-23908 on JIRA for the process of that. {quote}
  33. Hans Knöchel 2017-05-03

    Thanks Yahya! I've updated the underlaying Wiki-page, the docs will be updated the next time our docs team (cc [~bimmel]) pushed the wiki to the docs.
  34. Yahya Uddin 2017-05-04

    When will this be?
  35. Hans Knöchel 2017-05-04

    Anytime soon, usually around a release. But it's just a docs change right? You can see the updated page with the removed paragraph [here](https://wiki.appcelerator.org/display/guides2/iOS+Interactive+Notifications).
  36. Yahya Uddin 2017-05-04

    Cool thanks!

JSON Source