Xcode 8 APS Environment property won't set to production in entitlements file

I have push notifications working on my app. I went to go submit a new app update and I ran into an error with APS environment not being set. I hit fix issue and it created the entitlement file with APS environment set to development. To submit the app I obviously want this set to production. I change the value to production and proceed to archive the app for submission. It throws an error in the capabilities section for push notifications with the last past "Add the Push Notifications entitlement to your entitlements file" being red. So when I hit fix issue, it then changes the value of APS environment to development. I came across a suggestion to inspect the provisioning profile and look for the APS environment property. I went through the process of archiving and selected "Upload to App Store". When I finally reached the summary, I clicked on the provisioning profile attached to the binary and entitlements. I open the provisioning profile in a text editor and looked for the APS environment property. I did find the property and it is set to production in the provision profile. I decided to try another suggestion, which was to recreate the distribution provisioning profile. I did make a new one and that solution doesn't work either. From what I understand the APS environment property is based on the value in your provisioning profile.

Any help would be appreciated. Thanks.

Replies

Bump. Having problems with aps-environment and lack of documentation/guidance to get push notifications working again when building from Xcode 8.

Yeah, what is going on here, I am having the same problem. The profile has the correct enviroment set but xcode created the entitlement file with it set to development. If you edit it and change it to production the "fix it" button comes up and wants to set it back to development again.

I am worried that if I submit my app update I will turn off push notifications on production.

Did any of you find a solution for this. I have been sitting with this issue for two days. I am going crazy.

I am also looking for a solutuion to this, you have exactly described the issue I have. I have been stuck for days. Any solutions?

having same problem here. does anyone have any hints? sitting here for hours...


thanks

sooo I just figured out, that the aps-environment is set to "production" if you submit the app to testflight. As long as you just run it directly from xcode it stays in "development", no matter what provisioning profile you set...nice apple! ➖

I have been stuck for days,and i have sloved it by delete "Any Sdk" in "Code Sign Entitlements" ,
and it work on iOS 9.3.3 and 10.0.0.2 now


http://www.jianshu.com/p/62f631012853

I managed to fix this nasty XCode 8 issue for good thanks to the following post:


http://www.ryadel.com/le-tristi-novita-di-xcode-8-come-ripristinare-le-notifiche-push-dopo-upgrade/


Although it's not in English, I found my solution by looking at the first image within the post body: turning that switch on in XCode fixed my problem.

i have manual edit *.entitelments, set value of aps-environment to "production", text "Add the Push Notifications entitlement to your entitlements file" is shown in red, but archiving was successful.

Is this also true when submitting to the App Store even though the "archived-expanded-entitlements.xcent" file in the ipa says "development" for aps-environment?

Hi knja,

Do push notifications work when you submit app like that?

I have the same case as you. Also I am worry that as you.

This didn't work for me.