1

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 ?

2 Answers 2

2

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.

1
  • Thank you for your answer. I did make sure of that, I was testing on a device with a development certificate. Which is what I intended to do.
    – elamy
    Dec 22, 2017 at 10:16
1

I finally found the answer and it was quit simple : On Xcode, I had to go to App Settings -> Capabilities and switch Push Notifications to On.

I was following tutorial to generate the right certificate on the Apple Developer platform but they didn't talk about the action on Xcode. Probably thinking people already know that part.

I can now receive push notification on a iPhone !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .