iosapple-push-notificationsad-hoc-distribution

Unable to receive push notification in production-mode


I implemented my project for notification. I tested it in development Provisioning Profile (development cert), the device got the notification normally, but when I moved to the distribution mode

I have changed the ssl gateway to ssl://gateway.push.apple.com:2195 and the Provisioning to be in adhoc mode, my device did not receive any notification ):

What should I do to fix this issue ?


Solution

  • I have got the answer, the problem was from code sign:

    1. go to project->info -> config ->+ duplicate release configuration, name it (ad hoc)
    2. go to product->edit schema ->Archive ->Build configuration : ad hoc -> ok
    3. open organizer->submit.
    4. there is a window with 3 options will pop up, choose (save for Enterprise or ad hoc), there is an .ipa file will saved in the desktop, this is your app.
    5. plug in the device then open iTunes and select apps from the up bar
    6. check sync Apps and check your app then click Apply. After application has been in your device you can try the notification and it will work.