Beispiel #1
0
    def _send_notification(self, title, body, devices_ids):
        notification = FCMNotification(api_key=self.fcm_key)
        payload = {
            'priority': 'high',
            'registration_ids': devices_ids,
            'content_available': True,
            'notification': {
                'title': title,
                'body': body,
                'sound': 'default',
                'click_action': 'mynotes'
            },
            'data': {
                'type': 'mynotes'
            }
        }

        return notification.do_request(payload=json.dumps(payload), timeout=4000)