getDevicePushTokenAsync does not return FCM id. It always return Expo id

Hi,

Please provide the following:

  1. SDK Version: 36.0.0
  2. Platforms(Android/iOS/web/all): Android

I am trying to update my react native react app with Push notification. So I started with a demo react native app and tried following the steps from
/versions/v36.0.0/guides/push-notifications (steps 1 & 3 as this is still demo to see if it gets notifications)
&
/versions/v36.0.0/guides/using-fcm/

My App Code: https://github.com/aonamrata/ReactAwesomeness/tree/ReactExpoApp
I am getting both

let token = await Notifications.getExpoPushTokenAsync();

Ref: https://github.com/aonamrata/ReactAwesomeness/blob/ReactExpoApp/PushNotification.js#L20

and

let deviceToken = await Notifications.getDevicePushTokenAsync({ gcmSenderId: "xxx" });

but for some reason in both the cases it gives me expo token. I tried adding the FCM google-settings file too but still same result.
I am testing it by building an APK and testing it on a real Android device. :wink:

Sending notification from Expo notification tool --Works.
Sending notification from FCM dashboard without device id --Works.
Sending notification from FCM for a particular device – Does not works.

Is there anything that i am missing? We have an existing notification and I want the actual device Id to plug into that system.

Thanks.

Never mind I figured it out. we need to send gcmSenderId as project_id in service.json file not the service id in the UI for FCM.
But now i end up with 2 notifications.

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