NativeScript Plugin Firebase token not registering to Adobe Mobile Services

Viewed 172

I'm working on a NativeScript mobile application where I'm using nativescript-plugin-firebase to retrieve a Firebase token I then send to Adobe Mobile Services so that I can send push notifications from there to users of both platforms (Android and iOS):

FirebasePlugin.init({
    onMessageReceivedCallback: () => { ... },
    onPushTokenReceivedCallback: (token: string) => {
        AdobeAnalytics.getInstance().optIn();
        AdobeAnalytics.getInstance().setPushIdentifier(isAndroid ? token : new NSData({ base64Encoding: token }));
    }
});

This works fine on Android, where I can then send notifications from AMS to individual devices using the token or to multiple ones using AMS's segments.

However, on iOS it only works using the token, as AMS thinks there are no iOS devices registered. The requests triggered by setPushIdentifier returns 200 OK and something like this on both platforms:

{
    "d_blob": "...",
    "d_mid": "...",
    "d_ottl": 7200,
    "dcs_region": 6,
    "ibs": [],
    "id_sync_ttl": 604800,
    "subdomain": "mysandbox",
    "tid": "..."
}

I use a modified version of nativescript-adobe-marketing-cloud 1.5.0 that exposes that setPushIdentifier, but the implementation doesn't change.

I have also tried replacing nativescript-plugin-firebase with push-plugin, in which case I get an APNs token when using iOS instead of a Firebase one:

PushPlugin.init({
    onMessageReceivedCallback: () => { ... },
    onPushTokenReceivedCallback: (token: string) => {
        AdobeAnalytics.getInstance().optIn();
        AdobeAnalytics.getInstance().setPushIdentifier(isAndroid ? token : new NSData({ base64Encoding: token }));
    }
});

But the same thing happens.

0 Answers
Related