Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HTTP_METHOD_GET = "GET" HTTP_METHOD_POST = "POST" HTTP_METHOD_DELETE = "DELETE" HTTP_METHOD_UPLOAD = "UPLOAD" )
View Source
var ( PLATFORM_ALL = "all" PLATFORM_ANDROID = "android" PLATFORM_IOS = "ios" PLATFORM_WINPHONE = "winphone" )
View Source
var AdapterMap = make(map[AdapterType]Instance)
Functions ¶
func Register ¶
func Register(adapter AdapterType, ins Instance) (err error)
register adapter instance
func StructToMap ¶
func StructToMap(v interface{}) (m map[string]interface{})
Types ¶
type AdapterType ¶
type AdapterType int
var ( AdapterType_JPush AdapterType = 1 //极光推送 AdapterType_Fcm AdapterType = 2 //谷歌推送 AdapterType_Apns AdapterType = 3 //苹果推送 AdatperType_Umeng AdapterType = 4 //友盟推送 AdapterType_XinGe AdapterType = 5 //信鸽推送 AdatperType_Huawei AdapterType = 6 //华为推送 )
func (AdapterType) GoString ¶
func (t AdapterType) GoString() (name string)
func (AdapterType) String ¶
func (t AdapterType) String() (name string)
type AudienceType ¶
type AudienceType int
var ( AUDIENCE_TYPE_REGID_TOKEN AudienceType = 1 //按设备注册ID/token推送(device register id or device token) AUDIENCE_TYPE_TAG AudienceType = 2 //按标签推送(message group) )
type IPush ¶
type IPush interface { //push message to device PushNotification(msg *Notification) (MsgID string, err error) //enable or disable debug output Debug(enable bool) }
func New ¶ added in v1.1.0
func New(adapter AdapterType, args ...interface{}) (IPush, error)
get adapter instance with args...
type Notification ¶
type Notification struct { AudienceType AudienceType //推送类型 Audiences []string //设备注册ID或标签或别名 Platforms []string //推送平台(可为空) Title string //标题 Alert string //内容 SoundIOS string //iOS声音设置 无 默认 自定义(空字符串、声音文件名、default) SoundAndroid int //声音设置(0 默认 1 播放声音文件) Badge int //角标 Extra PushExtra //扩展结构,用于点击推送消息自动跳转页面(选填) }
Click to show internal directories.
Click to hide internal directories.