iOS push doesn't work when building from xcode

723 views Asked by At

I'm finding a strange discrepancy in the way that iOS push/APNS works for my app. (For background, the app in question uses Cordova together with the phonegap-plugin-push plugin.) If I download the app's current release from the app store, push works just fine. But if I build the app in release mode and run it on a test device using Xcode, no push notifications are ever received. This seems odd because I would have thought that either method produces essentially the same build.

2

There are 2 answers

0
T.Ratzz On

Try to sign you app using distribution certificate while building from Xcode.

0
gnasher729 On

Pushes from a released version must be sent to Apple's push server, while pushes from a development server must be sent to Apple's sandbox push server.

The recommended method is that your server code that sends the push sends it to the push server first, and on failure sends it to the sandbox push server. If your server code is written like that, it will handle both released and development versions just fine.

I've seen server libraries that must be configured to either send to the push server or to the sandbox push server. With that setup, you need different servers, one handling released apps, one handling development apps.

Try archiving the app and downloading the archive to your phone, if that works then your server is set up in this very inconvenient way.