[TIMOB-23908] Xcode 8: Builds with SDK 5.5.0 are missing APS-entitlements for push-notifications
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-23T19:22:26.000+0000 |
Affected Version/s | Release 5.5.0 |
Fix Version/s | Release 5.5.1 |
Components | iOS |
Labels | aps, entitlement, pushnotification, xcode8 |
Reporter | Peter Ladis |
Assignee | Chris Barber |
Created | 2016-09-14T12:36:57.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
Screen Shot 2016-09-14 at 8.30.56 AM.png | 2016-09-14T12:34:43.000+0000 | 173201 |
Screen Shot 2016-09-14 at 8.31.25 AM.png | 2016-09-14T12:34:43.000+0000 | 196151 |
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.
Having the same issue. I also cannot seem to work around it as building directly from XCode gives errors with hyperloop modules.
Same issue. But using xcode 7 instead of 8 with SDK 5.5 seems to include the APS entitlement.
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*: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!
Adding the
/platform/ios/<app-name>.entitlements
worked for me.This doesn't work for me. In my tiapp.xml, the name of my app is
Tried cleaning your project before building?
Yes.
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.
Exactly as in a previous comment.
Try to remove the comment, I don't think .entitlements files allow those kind of comments.
Nope. Removed comments, cleaned project, but still not working.
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.
Still not working. I'm sticking with 5.4… :-(
And your platform/ios/ folder is alongside Resources, not inside it? This works for my Classic style project, not sure about an Alloy project.
Yes… !http://www.grincheux.be/remote/entitlements.png!
Thanks for fix guys, adding the entitlements file did the trick - note the platform folder in question has actually moved else gets overwritten
For completeness, i copied the empty entitlements file from my build directory and added the entitlements
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!
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.
Creating the entitlement file with Alloy at app/platform/iphone/
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! :-)
[~kaiiserni] Good to know, thanks! [~jerodfritz] Can you test placing it in
app/platform/ios/
as well? Wondering if it needs to beiphone/
orios/
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).Docs PR for the first phase: https://github.com/appcelerator/titanium_mobile/pull/8393
Updated content looks good. Merged PR.
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.
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
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 EntitlementsWith SDK 5.5.1 I don't have to fix anything manually, right?
[~shawnlan] Correct!
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
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
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
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.
When will this be?
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).
Cool thanks!