Documentation ¶
Index ¶
Constants ¶
View Source
const ( HUAWEI_ERROR_CODE_SUCCESS = "80000000" //成功 HUAWEI_ERROR_CODE_OAUTH = "80200001" //Oauth认证错误, 请求HTTP头中Authorization参数里面的Access Token鉴权失败,请检查。 HUAWEI_ERROR_CODE_TOKEN_EXPIRE = "80200003" //Oauth Token过期, 请求HTTP头中Authorization参数里面的Access Token已过期,请重新申请后重试。 HUAWEI_ERROR_CODE_MESSAGE_BODY = "80100003" //消息结构体错误, 消息结构体参数携带错误,请按照此文档中请求参数部分进行检查。 HUAWEI_ERROR_CODE_OVERFLOW = "80300008" //消息体大小超过系统设置的默认值(4K) 请求消息体超默认值,请减小消息体后重试。 HUAWEI_ERROR_CODE_PERMISSION = "80300002" //APP被禁止发送当前应用无权限发送该消息,请检查应用权限。 HUAWEI_ERROR_CODE_INVALID_TOKEN = "80300007" //无效的Token消息请求携带的Push Token无效,请检查。 HUAWEI_ERROR_CODE_INTERNAL_SERVICE = "500" //内部服务器错误(与华为无关) )
Variables ¶
View Source
var ( HUAWEI_HTTP_METHOD_POST = "POST" HUAWEI_TOKEN_TYPE = "Bearer" //默认token类型 )
View Source
var ( HUAWEI_AUTH_V2_URL = "https://oauth-login.cloud.huawei.com/oauth2/v2/token" //完整URL "https://push-api.cloud.huawei.com/v1/[appid]/messages:send" HUAWEI_PUSH_API_URL = "https://push-api.cloud.huawei.com/v1" )
Functions ¶
This section is empty.
Types ¶
type HuaWei ¶
type HuaWei struct {
// contains filtered or unexported fields
}
func (*HuaWei) PushNotification ¶
func (h *HuaWei) PushNotification(msg *push.Notification) (MsgID string, err error)
Click to show internal directories.
Click to hide internal directories.