MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 4 as of 2020-10-28 15:16:14
  • Firebase

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

pyfcm

  • https://howto.lintel.in/push-notifications-using-python-via-fcm/

  • pip install pyfcm

   1 # the fcm client must subscribe a topic that matches the device uuid
   2 from pyfcm import FCMNotification
   3 
   4 cloud_messaging_server_key ="AAAA(...)" # missing data foe the key
   5 push_service = FCMNotification(api_key=cloud_messaging_server_key, proxy_dict=None)
   6 
   7 message_body = "Hello"
   8 data_message = {
   9     "user" : "Mario",
  10     "body" : message_body,
  11     "chatRoom" : "PortugalVSDenmark"
  12 }
  13 
  14 device_uuid="8ab6abc19dc54262"
  15 
  16 result = push_service.notify_topic_subscribers(topic_name=device_uuid, 
  17     message_body=message_body, data_message=data_message)
  18 print(result)
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01