Notification Register Push Token Error sdk-30.0.0

Hi, I have a strange error when some users are registering for push notifications on an actual device with the published app.

{"framesToPop":1,"code":"E_GET_GCM_TOKEN_FAILED","line":63,"column":1889,"sourceURL":"/data/user/0/helios.expo/files/30.0.0/cached-bundle-experience-%40patricklock%2Fhelios-app-expo-1186542293-30.0.0"}

Do you know what could be causing this error and how to catch it?

I am using sdk-30.0.0

I get the token using the documented code

let pushToken = await Notifications.getExpoPushTokenAsync();

Hey @patricklock,

Can you share the entire code relevant to this call? Aslo, if you haven’t already, you could wrap your code in a try/catch.

Cheers,
Adam

Hi @adamjnav I have put in a try catch block now as below

let pushToken = null;

    try {
        pushToken = await Notifications.getExpoPushTokenAsync();

        if (typeof pushToken !== 'string') {
            let pushTokenType = typeof pushToken
            return new Promise((resolve,reject)=>{
                reject('push token type ' + pushTokenType);
            });
        }
        SecureStore.setItemAsync('pushToken', pushToken);

    } catch(error){
        Sentry.captureException(new Error("Notifications.getExpoPushTokenAsync() " + JSON.stringify(error)));
        return new Promise((resolve,reject)=>{
            reject('error with Notifications.getExpoPushTokenAsync()');
        });
    }

I am also in the process of updating to SDK 33.0.0 to see if that helps

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.