0

I am developing a mobile application using Ionic and I've tried to include the MC-Cordova plugin (https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin).

The point is that I have everything up and running in Android but when it comes to iOS, I am not able to get any token value different than null.

I have properly uploaded the Apple certificates to the Salesforce dashboard, and I have no problems in registering devices in the platform (it sets properly the contact keys and all the information but the token).

The call to the function to get the token seems so easy to code:

 private getMCTokenAndListen(): void {
    window.MCCordovaPlugin.getSystemToken((token) => {
      console.log('GOT A NEW TOKEN:::', token);
    }, (err) => {
      console.log('ERR TOKEN', err);
    });

What am I missing? Or what am I doing wrong? Thanks in advance


EDIT: I just solved my problem by using the Capacitor Push Notification Plugin and modifying its 'AppDelegate' file in the 'didRegisterForRemoteNotificationsWithDeviceToken' function by calling the MCCordovaPlugin:

MarketingCloudSDK.sharedInstance().sfmc_setDeviceToken(deviceToken)

1 Answer 1

-1

According to the documentation getSystemToken supposed to return the token used by the Marketing Cloud to send push messages to the device. But that function is currently marked as "TODO".

If you want to generate a new token from FCM/APNs you may need to use https://github.com/havesource/cordova-plugin-push

You must log in to answer this question.

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