github.com/gorocks/apikit@v0.0.0-20170808011444-396ab031afbd/push/doc.go (about) 1 /* 2 Package push provides several push services API access. 3 4 Example (iOS only): 5 r := xg.SingleDeviceReq{} 6 r.AccessID = "" 7 localLoc, err := time.LoadLocation("Asia/Chongqing") 8 r.TimeStamp = strconv.FormatInt(time.Now().In(localLoc).Unix(), 10) 9 r.DeviceToken = "" 10 r.MessageType = "0" 11 r.Environment = "2" 12 r.Message = `{"aps":{"alert":"来自腾讯信鸽的提醒"}}` 13 resp, err := xg.SinglePush(&r, "") 14 fmt.Println(resp, err) 15 16 r := xg.MultipleDeviceReq{} 17 r.AccessID = "" 18 localLoc, _ := time.LoadLocation("Asia/Chongqing") 19 r.TimeStamp = strconv.FormatInt(time.Now().In(localLoc).Unix(), 10) 20 r.MessageType = "0" 21 r.Environment = "2" 22 r.Message = `{"aps":{"alert":"来自腾讯信鸽的提醒"}}` 23 r.DeviceList = []string{""} 24 xg.MultiPush(&r, "") 25 26 s := lc.New("", "") 27 r := lc.InstallationReq{} 28 r.DeviceType = "" 29 r.DeviceToken = "" 30 r.InstallationID = "" 31 r.Channels = []string{"all"} 32 s.SaveInstallation(&r) 33 */ 34 package push