0

I wonder if you could help me identifying some problems regarding implementation of MobilePush React Native Expo plugin (MobilePush React Native Expo Plugin). We are currently collaborating with another company (mobile dev part) in implementation of MobilePush. Current implementation works correctly on Android devices, where our contact gets into Marketing Cloud with the correct deviceId.

The problem occurs on iOS devices though. This is what our logs say:

LOG  Log event {"category": "sfmcsdk", "level": 0, "message": "The module is not operational yet. Status: failed. This task will be queued.", "subsystem": "SFMCSdk"}LOG  Log event{"category": "identity", "level": 0, "message": "Setting `0037E00001C0tMVQAZ` as profileId for all subscribed modules triggered.", "subsystem": "SFMCSdk"}LOG  Log event {"category": "eventBus", "level": 0, "message": "Message `IdentityEvent` received on the event bus.", "subsystem": "SFMCSdk"}LOG  Log event {"category": "sfmcsdk", "level": 0, "message": "The module is not operational yet. Status: failed. This task will be queued.", "subsystem": "SFMCSdk"}

This is our current implementation. We call this function after user gives permission to display push notifications. We use setSystemToken as in documentation. We then use setContactKey method for setting the contact (using delayRegistrationUntilContactKeyIsSet = true). Since it works on Android devices, we are kind of lost and we do not understand from where the problem originates.

const registerPushNotifications = async () => {
    try {
        const notificationToken = (await Notifications.getDevicePushTokenAsync()).data;

        if (!!notificationToken && !!data?.Profile?.ContactId) {
            // let Marketing Cloud SDK the value of current push token
            saveString(StorageKeys.NOTIFICATION_TOKEN, notificationToken);
            await MarketingCloud.setSystemToken(notificationToken);
            await MarketingCloud.enablePush();
            await MarketingCloud.setContactKey(data.Profile.ContactId);
        } else {
            remove(StorageKeys.NOTIFICATION_TOKEN);
        }

        if (isAndroid) {
            await Notifications.setNotificationChannelAsync('default', {
                name: 'default',
                importance: Notifications.AndroidImportance.MAX,
                vibrationPattern: [0, 250, 250, 250],
                lightColor: '#FF231F7C',
            });
        }

        setIsLoading(false);
        router.replace('/(tabs)/home');
    } catch (error) {
        catchError(error);
    }
};

I noticed that they are using expo-notifications library. Could the problem be related to this? I read through docs and forums and came to realization that using multiple push providers is a source of these problems. The docs say that installing the library is required for this plugin to work so that we can create token (getDevicePushTokenAsync). I just wanted to make sure before I make any drastic decisions. It still seems weird that Android works correctly. Another weird fact is that this already worked on iOS 1 month ago. Later it suddenly stopped sending contacts to MC. We started investigating and the logs printed out what I pasted above.

1 Answer 1

0

The expo library is not developed by Salesforce. Here is the Salesforce ReactNative plugin. Hope this helps!.

You must log in to answer this question.

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