Skip to content

cossteam/vivo-push

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vivo-push

Vivo推送服务 Golang SDK

full golang implementation of Vivo Push API (https://dev.vivo.com.cn/documentCenter/doc/155)

import (
    "fmt"

    vv "github.com/Maythink/vivo-push"
)

func main() {
	client, err := vv.NewClient("your appId", "your appKey", "your appSecret")
	if err != nil {
		return
	}

	// 单推
	msg1 := vv.NewVivoMessage("hi baby", "hi")
	_, err = client.Send(msg1, "regID")
	if err != nil {
		fmt.Println(err)
		return
	}

	// 群推
	msg2 := vv.NewListPayloadMessage("hello baby", "hello")
	_, err = client.SendList(msg2, []string{"regID1", "regID2"})
	if err != nil {
		fmt.Println(err)
		return
	}

	//全量推送
	msg3 := vv.NewListPayloadMessage("hi all baby", "hi all")
	_, err = client.SendAll(msg3)
	if err != nil {
		fmt.Println(err)
		return
	}

	return
}

Sender APIs

  • Send(msg *Message, regID string)
  • SendList(msg *MessagePayload, regIds []string)
  • SendAll(msg *MessagePayload)

Stats APIs

  • GetMessageStatusByJobKey(jobKey string) (*BatchStatusResult, error)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%