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
development
option, and can still receive remote push notification. at the meantime, the mobileprovision file in archived app shows theproduction
aps-environment
option – Prod