Skip to content

Commit 562fbb0

Browse files
author
施凯伦
committed
update readme
1 parent 2209bfd commit 562fbb0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# xiaomi-push
22
小米推送服务 Golang SDK
33

4-
full golang implementation of XiaoMi Push API (http://dev.xiaomi.com/console/?page=appservice&mod=push)
4+
Production ready, full golang implementation of Xiaomi Push API (http://dev.xiaomi.com/console/?page=appservice&mod=push)
55

66
```Go
7-
import (
8-
"fmt"
9-
10-
xm "github.com/yilee/xiaomi-push"
11-
)
12-
13-
var client = xm.NewClient("yourappSecret", []string{"packageName"})
7+
var client = xiaomipush.NewClient("yourappSecret", []string{"packageName"})
148

159
func main() {
16-
var msg1 *Message = NewAndroidMessage("hi baby1", "hi1").SetPayload("this is payload1").SetPassThrough(0)
17-
client.Send(msg1, regID1)
10+
var msg1 *Message = xiaomipush.NewAndroidMessage("title", "body").SetPayload("this is payload1")
11+
client.Send(context.Background(), msg1, regID1)
1812
}
1913

2014
```

0 commit comments

Comments
 (0)