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)