[SalesForce] Cannot send push notification to iOS device

I have a Cordova app with the Marketing Cloud cordova plugin (https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin).

Although I had some difficulty to make it work on android (cf What is the minimum version of Cordova required to use the Marketing Cloud Cordova plugin?) I can now register a device and receive push notification from an Android device.

But now I have to make it work on iOS and even though I can see the device being registered on MobilePush. I cannot send notification to it.

The device is shown as "Not Opted In" and the "Opt Out Source" is marked as ServiceFeedback.

I have configured an APNS Certificate for the app.

How can I send notification to iOS ? What is the cause of the Opt Out ?

Best Answer

The primary difference between iOS and Android when dealing with push notifications is the provisioning process and understanding Apple's APNS/Push process. The cause of your opt-out is probably or most often because the application is not registered properly for push messages.

  1. Make sure if you are building a production build you realize it can NOT be tested within XCode. You can only test development builds using XCode and of course only on a device, not an emulator. If you want to test a production build, make sure sign the app appropriately with the correct entitlements, and archive and do an install on the device. Either way, make sure the correct entitlements are chosen for prod or dev and make sure you enable push under the Capabilities tab.

  2. Make sure you are also using only the correct provisioning profile for the production or development environment. It's easy to sometimes get these confused and upload the wrong p12 file to your production or development environment.

Related Topic