iOSPushSDK

package module
v0.0.0-...-98325f9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 10 Imported by: 0

README

iOSPushSDK

iOSPushSDK

Documentation

Index

Constants

View Source
const (
	ProductionHost = "https://api.development.push.apple.com"

	MessageURL = "/3/device/"
)
View Source
const (
	Success                     = 200 // 成功
	ErrorRequest                = 400 // 错误的请求
	ErrorAuthToken              = 403
	ErrorMethod                 = 405
	TimeOutDeviceToken          = 410
	NotificationPayloadTooLarge = 413
	TooManyRequest              = 429
	InternalServerError         = 500
	ServerUnavailable           = 503
)

Variables

This section is empty.

Functions

func GetAuthToken

func GetAuthToken(authTokenPath string, keyID string, teamID string) (string, error)

Types

type Alert

type Alert struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type Aps

type Aps struct {
	Alert Alert `json:"alert"`
	Badge int   `json:"badge"` // 右上角小图标
}

type ErrResult

type ErrResult struct {
	Reason string `json:"reason"`
}

type Fields

type Fields struct {
	Aps Aps `json:"aps"`
}

type Message

type Message struct {
	Fields string
}

func InitMessage

func InitMessage(title string, desc string, passThrough string) *Message

func (*Message) GetFields

func (m *Message) GetFields() string

type Result

type Result struct {
	ApnsId string `json:"apns-id"`
	Status int    `json:"status"`
	Reason string `json:"reason"`
}

func MessagesSend

func MessagesSend(message *Message, token string, authToken string, bundleID string) (*Result, error)

func PostResult

func PostResult(requestPath string, fields string, retries int, authToken string, bundleID string) (*Result, error)

Jump to

Keyboard shortcuts

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