-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
29 lines (19 loc) · 785 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Python Huawei Cloud Messaging
Wrapper of huawei cloud messaging [(Push Kit)](https://developer.huawei.com/consumer/en/hms/huawei-pushkit/) for sending push notification using python.
## Home page
https://pypi.org/project/pyhcm/
## Install
```pip install pyhcm```
## Example
### Send notification to topic
```
CLIENT_ID = "00000000"
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_topic_subscribers('test_topic', 'test title', 'test body')
```
### Send notification to user
```
CLIENT_ID = "00000000"
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_single_device('token_xyz', 'test title', 'test body')
```