0

When enabling push notifications for an app id it must be enabled both for development and for production.

enter image description here

However the entitlements file only contains a "development" value for the APS key, not both a "development" and a "production" value: enter image description here

If a production archive is made and then the entitlement's file within the .ipa examined it contains the "development" value for the apn key, not a value of "production". However if this archive is then exported for an ad-hoc distribution, then the entitlements file within the resulting .ipa is still also "development". Why is that?

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
  • When you archive, it will automatically choose the correct environment when you export for AppStore or upload. – Brandon Mar 26 '17 at 15:59
  • I am creating a production .ipa *via* archive. – Gruntcakes Mar 26 '17 at 16:08
  • But are you using AppStore certificate or adhoc? – Brandon Mar 26 '17 at 16:08
  • adhoc, but the whole point of adhoc is to enable testing before App Store. Hence presumably it must surely produce identical results. http://stackoverflow.com/questions/12447025/how-to-test-production-push-notifications/13975158#13975158 – Gruntcakes Mar 26 '17 at 16:15

1 Answers1

0

Do not look at the entitlements file in the Xcode project. Do not look at the entitlements file in the archive. The only thing that matters is the entitlements file that you get when you have exported from the archive to make your ad hoc file. It will have the correct entitlements.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Its the same. I created an achieve then looked at the resulting .ipa within the produced .xcarchive file, in there the aps-environment is set to development. Next I chose to export the archive and chose ad-hoc distribution. Then I looked at the .ipa resulting from that export and in there the aps-environment is also set to development.(Within the scheme, archive is set to release, its not been accidentally set to debug) – Gruntcakes Mar 26 '17 at 16:35
  • Load the ad hoc distributed app onto your own device. Does it work? – matt Mar 26 '17 at 17:16