= Firebase = * https://firebase.google.com/ * https://en.wikipedia.org/wiki/Firebase Firebase is a platform developed by Google for creating mobile and web applications. == Cloud messaging == * https://firebase.google.com/products/cloud-messaging * https://firebase.google.com/docs/cloud-messaging * https://console.firebase.google.com/project/_/notification * https://console.firebase.google.com/project/bitarus-sandbox-fcm/notification Check the server key for cloud messaging settings * https://console.firebase.google.com/project/bitarus-sandbox-fcm/settings/cloudmessaging/android:org.allowed.bitarus.ionic.starter == pyfcm == * https://howto.lintel.in/push-notifications-using-python-via-fcm/ * pip install pyfcm {{{#!highlight python # the fcm client must subscribe a topic that matches the device uuid from pyfcm import FCMNotification cloud_messaging_server_key ="AAAA(...)" # missing data for the key push_service = FCMNotification(api_key=cloud_messaging_server_key, proxy_dict=None) message_body = "Hello" data_message = { "user" : "Mario", "body" : message_body, "chatRoom" : "PortugalVSDenmark" } device_uuid="8ab6abc19dc54262" result = push_service.notify_topic_subscribers(topic_name=device_uuid, message_body=message_body, data_message=data_message) print(result) }}} === single_dev_pyfcm.py === {{{#!highlight python #send push to target device with registered token getToken() #python single_dev_pyfcm.py "Test hello push" from pyfcm import FCMNotification import uuid import sys dev_token="eBSZS..." cloud_messaging_server_key ="AAAA0..." push_service = FCMNotification(api_key=cloud_messaging_server_key, proxy_dict=None) body = "Hello" if len(sys.argv)>1: body = sys.argv[1] data_message = { "body" : body, } res = push_service.notify_single_device(registration_id=dev_token, message_title="Title", message_body=body, data_message=data_message) print(res) }}}