views:

436

answers:

2

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?

http://stackoverflow.com/questions/2585667/problem-generating-apn-ssl-certificate-after-submitting-to-apple-store

A: 

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.

Ben Gottlieb
By complete, do you mean a non-wildcard ID? If so, yep it was a completely different app id.I actually tested the ad hoc application using the an ID that ended with ".adHoc" and that worked fine - then I submitted the application using an ID that ended with ".release". That was the only change.Once I found out about this problem, I made an ad hoc provisioning profile for the ".release" app ID and installed it on my phone - and push notifications worked!
MikeQ
+2  A: 

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

tonyj
Oh wow thanks! Yep, that was it. I checked the original distribution profile, and that key was not there. I guess which order you take these steps really *does* matter.
MikeQ