Help us shape the future of Go! Take the 2026 Go Developer Survey

push

package module
v0.0.0-...-77f837b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

xiaomi-go-sdk-push

xiaomi push service sdk, in golang

It's a golang sdk for xiaomi push. Refer to example/main.go for usage.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AppSecret string
}

Client is used to send push request.

func NewClient

func NewClient(appSecret string) *Client

NewClient function construct a new Client.

func (Client) SendRequest

func (c Client) SendRequest(r *Request) (string, error)

SendRequest method sends out a PushRequest.

type Request

type Request struct {
	// push target
	TargetType            string //all, regid, alias, user_account, topic, multi_topic
	TargetValue           string
	RestrictedPackageName string

	// push configuration
	Title       string
	Description string
	Payload     string

	// IOS specific
	ExtraBadge    int
	ExtraCategory int

	// Android specific
	PassThrough           int
	NotifyType            int
	NotifyID              int
	ExtraSourceURI        string
	ExtraTicker           string
	ExtraNotifyForeground int
	ExtraNotifyEffect     int
	ExtraIntentURI        string
	ExtraWebURI           string
	ExtraFlowControl      int
	ExtraLayoutName       string
	ExtraLayoutValue      string
	ExtraJobkey           string
	ExtraCallback         string
	ExtraLocale           string
	ExtraLocaleNotIn      string
	ExtraModel            string
	ExtraModelNotIn       string
	ExtraAppVersion       string
	ExtraAppVersionNotIn  string
	ExtraConnpt           string

	// Message control
	TimeToSend   int // milliseconds since 1970.1.1 00:00:00 UTC
	TimeToLive   int // milliseconds to keep message
	StoreOffline bool
	ExpireTime   string
	BatchNumber  string
}

PushRequest struct represents a message to be pushed to mobile.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL