8a882f01
aarongao
1.0
|
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
|
package main
import (
"fmt"
"github.com/aliyun/alibaba-cloud-sdk-go/services/push"
)
func main() {
// 推送app消息
client, err := push.NewClientWithAccessKey("cn-hangzhou", "LTAI4FdQeNMQXRU6u5J3EFQc", "PwvyF5rRNBWLDya41WrCpvENevYZGi")
request := push.CreatePushNoticeToiOSRequest()
request.ApnsEnv = "DEV"
request.AppKey = "28332889"
request.Scheme = "https"
request.Target = "DEVICE"
request.TargetValue = "30076ed6fdb740e49d882433931bc34a"
request.Title = "消息测试1"
request.Body = "消息测试2"
response, err := client.PushNoticeToiOS(request)
if err != nil {
fmt.Print(err.Error())
}
fmt.Printf("response is %#v\n", response)
}
|