forked from olucurious/PyFCM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
14 lines (14 loc) · 639 Bytes
/
Copy pathtest.py
File metadata and controls
14 lines (14 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'olucurious'
from pyfcm import FCMNotification
from pprint import pprint
push_service = FCMNotification(api_key="<server key>")
registration_id="<device registration_id>"
message = "Hope you're having fun this weekend, don't forget to check today's news"
result = push_service.notify_single_device(registration_id=registration_id)
pprint(result)
result = push_service.notify_multiple_devices(registration_ids=[registration_id,registration_id,registration_id])
pprint(result)
result = push_service.notify_topic_subscribers(topic_name="global", message_body=message)
pprint(result)