what is Device Registration ID for firebase fcm and where I can extract them?

2.9k Views Asked by At
from pyfcm import FCMNotification

push_service = FCMNotification(api_key="<api-key>")

registration_id = "<device registration_id>"
message_title = "Uber update"
message_body = "Hi john, your customized news for today is ready"
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title, message_body=message_body)

print result

I am working on Pyfcm for push notification, for which i want to get the device registration id.

1

There are 1 best solutions below

2
On BEST ANSWER

You can get token(=device registration_id)

In my code:

String newToken= instanceIdResult.getToken();

Maybe in your code:

String newToken = FirebaseInstanceId.getInstance().getToken();

so newToken = device registration_id