mohamed ziedi
mohamed ziedi

Reputation: 43

I want to Send FCM notification using python

i want to send fcm notification to topic using just python

from pyfcm import FCMNotification

API_KEY = "AAAA...Gzzjo"


push_service = FCMNotification(api_key=API_KEY)

data = {'notification': {'title': 'Test','body': 'first test'}
        , 'data':{'click_action':'FLUTTER_NOTIFICATION_CLICK'}}

print(push_service.notify_topic_subscribers(topic_name="topicname", data_message=data))

but the notification didn't send to the topic and keep showing me this

{'multicast_ids': [], 'success': 1, 'failure': 0, 'canonical_ids': 0, 'results': [], 'topic_message_id': 4051394435713630091}

any solution ?

Upvotes: 4

Views: 1285

Answers (0)

Related Questions