Reputation: 548
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.
Upvotes: 4
Views: 3056
Reputation: 46
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
Upvotes: 3