You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
849 B
32 lines
849 B
package logic
|
|
|
|
import (
|
|
"Open_IM/internal/push/sdk/tpns-server-sdk-go/go/auth"
|
|
"Open_IM/pkg/common/config"
|
|
)
|
|
|
|
var badgeType = -2
|
|
var iosAcceptId = auth.Auther{AccessID: config.Config.Push.Tpns.Ios.AccessID, SecretKey: config.Config.Push.Tpns.Ios.SecretKey}
|
|
|
|
func IOSAccountListPush(accounts []string, title, content, jsonCustomContent string) {
|
|
var iosMessage = tpns.Message{
|
|
Title: title,
|
|
Content: content,
|
|
IOS: &tpns.IOSParams{
|
|
Aps: &tpns.Aps{
|
|
BadgeType: &badgeType,
|
|
Sound: "default",
|
|
Category: "INVITE_CATEGORY",
|
|
},
|
|
CustomContent: jsonCustomContent,
|
|
//CustomContent: `"{"key\":\"value\"}"`,
|
|
},
|
|
}
|
|
pushReq, reqBody, err := req.NewListAccountPush(accounts, iosMessage)
|
|
if err != nil {
|
|
return
|
|
}
|
|
iosAcceptId.Auth(pushReq, auth.UseSignAuthored, iosAcceptId, reqBody)
|
|
common.PushAndGetResult(pushReq)
|
|
}
|