Skip to content

Commit dcc1565

Browse files
authored
Updated readme (#4)
1 parent 54ad339 commit dcc1565

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

README

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Python Huawei Cloud Messaging
2+
3+
Wrapper of huawei cloud notification API for sending push notification using python.
4+
5+
## Install
6+
```pip install pyhcm```
7+
8+
## Example
9+
10+
### Send notification to topic
11+
```
12+
CLIENT_ID = "00000000"
13+
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
14+
15+
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_topic_subscribers('test_topic', 'test title', 'test body')
16+
```
17+
18+
### Send notification to user
19+
20+
```
21+
CLIENT_ID = "00000000"
22+
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
23+
24+
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_single_device('token_xyz', 'test title', 'test body')
25+
```

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# Python Huawei Cloud Messaging
22

3-
Wrapper of api push huawei for sending notification push using python.
3+
Wrapper of huawei cloud notification API for sending push notification using python.
44

55
## Install
66
```pip install pyhcm```
77

88
## Example
99

10-
### Subcribers topic
10+
### Send notification to topic
1111
```
1212
CLIENT_ID = "00000000"
1313
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
1414
1515
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_topic_subscribers('test_topic', 'test title', 'test body')
16+
```
17+
18+
### Send notification to user
19+
20+
```
21+
CLIENT_ID = "00000000"
22+
CLIENT_SECRET = "0000000000000000000000000000000000000000000000000000000000000000"
1623
1724
HCMNotification(CLIENT_ID, CLIENT_SECRET).notify_single_device('token_xyz', 'test title', 'test body')
1825
```

0 commit comments

Comments
 (0)