How do I get the FCM device registration_id

On the backend I’m using PyFCM and it requires the device registration_id.

How do I get that in Capacitor on Android? This tutorial, which works for sending the first test message, does not have the registration_id. I can send the first test message to all users of the app but I cannot yet get it to work with Python on the backend to message this specific app installation.
https://capacitor.ionicframework.com/docs/guides/push-notifications-firebase#android

To be clear, I’m asking for Capacitor support (not Python) needing to send the registration_id from Android to the backend, but this newbie doesn’t know how to obtain that token.

ciao!

I dont know how does it work, but with the capacitor native plugin i get it this way:

PushNotifications.addListener(
  'registration',
  (id: PushNotificationToken) => {
    this.userRegistrationId = JSON.stringify(id.value);
  }
);
1 Like