mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Conflicts: cmd/api/main.go go.mod internal/push/fcm/push.go internal/push/getui/push.go internal/push/logic/init.go internal/push/logic/push_to_client.go internal/push/push_rpc_server.go internal/rpc/conversation/conversaion.go pkg/common/db/controller/group.go pkg/proto/push/push.pb.go
32 lines
848 B
Go
32 lines
848 B
Go
package push
|
|
|
|
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)
|
|
}
|