when using xcode 8
doing the push notification setting, unlike xcode 7
, xcode 8
need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities
as following pic ),
then it will generate AppName.entitlements file as following
//AppName.entitlements <key>aps-environment</key> <string>development</string>
but for production version App, if we change the string to
//AppName.entitlements <key>aps-environment</key> <string>production</string>
then the Capabilities show a warning
and it seems no matter which string value specified in aps-environment, we can still get the push device token at application:didRegisterForRemoteNotificationsWithDeviceToken:
so what is the correct setting of the push notification entitlements? thank you
Select iOS > Resource > Property List. Name the new file " foo. entitlements " (typically, " foo " is the target name) Click the (+) next to "Entitlements File" to add a top-level item (the property list editor will use the correct schema due to the file extension)
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.
An app stores its entitlements as key-value pairs embedded in the code signature of its binary executable. You configure entitlements for your app by declaring capabilities for a target in Xcode. Xcode records capabilities that you add in a property list file with the . entitlements extension.
I was struggling with that today in Xcode 8 GM. After disabling the setting, deleting my developer portal provisioning profile and regenerating it and enabling the setting again, I was able to eliminate the warning in Xcode. Keep in mind that I didn't fiddle with the entitlements file. I left it at development environment and after archiving I got the correct aps-environment setting (production).
Seems Xcode is stilly very buggy tho even in GM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With