Reputation: 1553
I'm working on a project where I have to push notifications using pyfcm. I created a firebase project and I took the api key and created an FCMNotification like this :
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="my api key")
Then I create a message and sent it to an already subscribed topic
data = {"notification" : {
"body" : "Body of Your Notification",
"title": "Title of Your Notification"
}
}
r = push_service.notify_topic_subscribers(topic_name="user-17", data_message=data)
On this side everything works fine I get the following success message
{'multicast_ids': [], 'success': 1, 'failure': 0, 'canonical_ids': 0, 'results': [], 'topic_message_id': 8479629199217820144}
but in firebase console at https://console.firebase.google.com/u/0/project/project_name/notification it doesn't show the notifications sent by fcm. Although the notifications pushed from postman are being shown.
Please if you can guide me through this I'd appreciate it thanks.
Upvotes: 2
Views: 357