/firebase-messaging

Firebase messaging for humans

Primary LanguagePythonApache License 2.0Apache-2.0

Firebase-messaging for humans

Simple use (send to one topic):

firebase_response = firebase.send_notification(push_topic=topic,
                                                       title=card.card_title,
                                                       body=card.notification_text,
                                                       action=push_action,
                                                       card_id=card.sid())                                                      

Send to all:

firebase_response = firebase.send_notification(send_to_all=True,
                                                       title=card.card_title,
                                                       body=card.notification_text,
                                                       action=push_action,
                                                       card_id=card.sid())

Silent push:

translated_id = account_id.translate(None,":")
firebase.send_notification(action=PushActions.SILENT_UPDATE_ACCOUNT,
                                           push_topic=translated_id,
                                           device_id=device_id,
                                           silent=True,)