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

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • 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

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

   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 for 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)

single_dev_pyfcm.py

   1 #send push to target device with registered token getToken()
   2 #python  single_dev_pyfcm.py "Test hello push"
   3 from pyfcm import FCMNotification
   4 import uuid
   5 import sys
   6 
   7 dev_token="eBSZS..."
   8 cloud_messaging_server_key ="AAAA0..."
   9 push_service = FCMNotification(api_key=cloud_messaging_server_key, proxy_dict=None)
  10 
  11 body = "Hello"
  12 
  13 if len(sys.argv)>1:
  14     body = sys.argv[1]
  15 
  16 data_message = {
  17     "body" : body,
  18 }
  19 
  20 res = push_service.notify_single_device(registration_id=dev_token, 
  21     message_title="Title", 
  22     message_body=body, data_message=data_message)
  23 print(res)
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01