This is a creation in Article, where the information may have evolved or changed.
#快速开始
# # #下载安装
go get github.com/mnhkahn/BaiduYunPush
# # #创建文件pushtest. Go
package mainimport ( "fmt" "github.com/mnhkahn/BaiduYunPush")var apikey = "**************************"var seckey = "******************************"var method = "POST"var url_base1 = "channel.api.duapp.com/rest/2.0/channel/channel"func main() { push := BaiduYunPush.New(apikey, seckey) s, err := push.Push("推送成功", "这是我的个人博客blog.cyeam.com") fmt.Println(s, err)}
# # #编译运行
go run pushtest.go
When true the console is displayed, the push succeeds. At this point, the device that is bound by the SDK displays the push message.
Reference documents
- "1" Baidu Open cloud Document
The original link: Baidu Cloud push send--go language Realization class library, reprint please indicate source!