Reputation: 315
I'm using the fcm_django package to send notifications API to Firebase but I have some confusion about those two concepts on Firebase like so: (registeration_id and device_id)
https://fcm-django.readthedocs.io/en/latest/#setup
I placed the "server_key" of Firebase to registration_id but don't understand what does device_id means and what is the value I should put on it?
after answering the above questions I tried to send notification from Django by the admin page on Django by creating registration_id which is "server_key" and defining the type which is a "web", but when I created this object I didn't see any message has been sent to Firebase cloud.
Note:-
I want to send notifications to only one device not many users.
so, can anyone help me to achieve this mission succeeded? Thanks in advance
Upvotes: 2
Views: 850
Reputation: 599926
The device_id
is a token that is generated by the Firebase SDK on each device/app combination that wants to receive messages from FCM.
To learn how to access this token, have a look at the documentation for Android, Web and iOS.
Once you have the token on the specific client, you will need to send it to a place where the fcm-django
package can then also access it; typically a cloud hosted database, such as the Realtime Database or Firestore that are also part of Firebase.
From there your Django can then get the token, and pass it to the fcm-django
API.
Upvotes: 1