How can I send push notifications from python?

1

I'm trying to make a program that communicates with Firebase and this sends push notifications to a single device on Android, I've been able to send notifications from Firebase but not from a Python program.

push_service = FCMNotification(api_key="<api-key>")

proxy_dict = {
          "http"  : "http://127.0.0.1",
          "https" : "http://127.0.0.1",
        }
push_service = FCMNotification(api_key="<api-key>", proxy_dict=proxy_dict)

registration_id = "<device registration_id>"
message_title = "Prueba"
message_body = "Mensaje de prueba"
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title, message_body=message_body)

print result

I'm using the api key that Firebase releases and the token id or registration id of the app which will receive the notification.

    
asked by Diego Porro 06.03.2018 в 16:26
source

1 answer

1

I recommend that you use PyFCM link is easy to use. I've already used it to send push notifications for firebase from python

    
answered by 06.03.2018 в 18:40