In my app, I need push notifications. I am implementing all the instructions from the push notifications docs. But I got an error from Push Notification:
Fai
Generate a new provisioning profile, after you enable Push, and it will work!
That was making me crazy. I cross-checked everything but still was getting the same error. Tried all the other solution given on the web as well. However, this did the trick for me. I create .mobileprovision file before enable APNS. This was the real mistake. Resolution of this problem :
If you have created provisioning profile earlier and the you have enabled APNS , you should delete provisioning file from everywhere in your system(XCode,keychain,iTuneConnect). And then create provisioning file again.
ok, a little embarrassing, but sometimes you spend hours on the most idiotic bugs -
so, I run the application on DEBUG mode instead of AD-HOC.
to change that, do:
scheme -> Edit Scheme...
select Run on the left, and change to Ad-Hoc dist under Build Configuration.
*of course you need to have the suitable adhoc provisioning profile under build-setting\code signing as well as the suitable APNS certificate attached to it when you create the provisioning profile.
** once you run it, it'll crush cause its not on DEBUG mode, but you can still run in from the device.