pyfcm

'certificate verify failed' when using PyFCM to send a Push Notification

混江龙づ霸主 提交于 2019-12-11 04:13:29
问题 I'm trying to send push notifications via PyFCM (via Firebase Cloud Messaging). When I tried to do this initially, I got the SNIMMissingWarning telling me that the request to the Firebase server was insecure. I upgraded packages to handle this, but now I'm stuck with a 'certificate_verify_failed' error. I went through the PyFCM code and found that it was using the requests module to send a request to the server. I know that this issue is related to not having the CA certificates for the

Ensuring onMessageReceived() is invoked when a FCM data message is sent even when App is closed

扶醉桌前 提交于 2019-12-02 02:00:16
问题 I am trying to send FCM data messages from my server. This is how a message request looks like: POST https://fcm.googleapis.com/fcm/send Content-Type:application/json Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA { "data": { "score": "5x1", "time": "15:10" }, "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1..." } or, when I use PyFcm : push_service = FCMNotification(api_key=MY_API_KEY) data_payload = {"score": "5x1", "time": "15:10"} push_service.notify_single_device(registration_id=

Ensuring onMessageReceived() is invoked when a FCM data message is sent even when App is closed

笑着哭i 提交于 2019-12-01 23:29:38
I am trying to send FCM data messages from my server. This is how a message request looks like: POST https://fcm.googleapis.com/fcm/send Content-Type:application/json Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA { "data": { "score": "5x1", "time": "15:10" }, "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1..." } or, when I use PyFcm : push_service = FCMNotification(api_key=MY_API_KEY) data_payload = {"score": "5x1", "time": "15:10"} push_service.notify_single_device(registration_id="bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...", data_message=data_payload) I made sure it is a data message