4
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.

KENdi
  • 7,576
  • 2
  • 16
  • 31
Harshit verma
  • 506
  • 3
  • 25

1 Answers1

3

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

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103