Push notifications work for Ad Hoc, but not when d

2019-02-04 17:07发布

My app just got approved for the apple store. I downloaded it an installed it on my iPhone - but it looks like push notifications are broken!

I was successfully testing push notifications in production using an adHoc provisioning profile. I had no problems. The only thing I did differently when I submitted to apple was using an app store distribution profile.

The application never asks me (or anyone else who has downloaded it) if I want to receive push notifications. Consequently, the phone never talks to my server to send the push token (because application:didRegisterForRemoteNotificationsWithDeviceToken: is presumably never called). Also the application does not appear in the settings app under the notification settings.

What could I be doing wrong??

EDIT: While the app was awaiting approval, I was having some trouble generating my production push certificate. Could this be relevant?

Problem generating APN SSL certificate after submitting to apple store

2条回答
不美不萌又怎样
2楼-- · 2019-02-04 17:22

Did you use the same Application ID for both the ad-hoc and the distribution mobileprovision files? It needs to be a complete identifier, rather than just partial.

查看更多
Evening l夕情丶
3楼-- · 2019-02-04 17:37

Be sure you've created your production App ID and have enable push notifications upon it. Then create the provisioning profile for that app. Download and open the file with a text editor to MUST make sure that the profile contains this key and value:

aps-environment production

If not, then make sure you really have enabled the app ID for production push before you generated your provisioning profile.

After you make your build, you can check the final build to verify it has the aps-environment entitlement (you're looking for the aps-environment code signing entitlement under "Internal requirements):

codesign -dvvvv --entitlements - MyCoolApp.app

查看更多
登录 后发表回答