We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android可以正常收发,IOS,retcode是0,但是客户端收不到,麻烦帮忙看下,多谢
`func PushIOSMessage(rids []int, title, content, appID, secretKey string) error { accounts := make([]string, len(rids)) for i, rid := range(rids) { accounts[i] = strconv.Itoa(rid) }
var pushReq *http.Request if gin.Mode() == "debug" { pushReq, _ = req.NewPushReq( &xinge.Request{}, req.Platform(xinge.PlatformiOS), req.EnvDev(), req.AudienceType(xinge.AdAccountList), req.MessageType(xinge.MsgTypeNotify), req.AccountList(accounts), req.PushID("0"), req.Message(xinge.Message{ Title: title, Content: content, }), ) } else { pushReq, _ = req.NewPushReq( &xinge.Request{}, req.Platform(xinge.PlatformiOS), req.AudienceType(xinge.AdAccountList), req.MessageType(xinge.MsgTypeNotify), req.AccountList(accounts), req.PushID("0"), req.Message(xinge.Message{ Title: title, Content: content, }), ) } return pushMessage(pushReq, appID, secretKey)
}
func pushMessage(pushReq* http.Request, appID, secretKey string) error { auther := auth.Auther{AppID: appID, SecretKey: secretKey} auther.Auth(pushReq)
c := &http.Client{} rsp, err := c.Do(pushReq) if err != nil { log.Error(err) return err } defer rsp.Body.Close() body, _ := ioutil.ReadAll(rsp.Body) r := &xinge.CommonRsp{} json.Unmarshal(body, r) if r.RetCode != 0 { msg := fmt.Sprintf("%+v", r) log.Error(msg) return errors.New(msg) } return nil
} `
The text was updated successfully, but these errors were encountered:
同样的问题
Sorry, something went wrong.
IOS: &xinge.IOSParams{ Custom: message.Params, Aps: &xinge.Aps{ Alert: map[string]string{ "title": message.Params["title"], "content": message.Content, }, Badge: 1, Sound: "default", }, },
No branches or pull requests
Android可以正常收发,IOS,retcode是0,但是客户端收不到,麻烦帮忙看下,多谢
`func PushIOSMessage(rids []int, title, content, appID, secretKey string) error {
accounts := make([]string, len(rids))
for i, rid := range(rids) {
accounts[i] = strconv.Itoa(rid)
}
}
func pushMessage(pushReq* http.Request, appID, secretKey string) error {
auther := auth.Auther{AppID: appID, SecretKey: secretKey}
auther.Auth(pushReq)
}
`
The text was updated successfully, but these errors were encountered: