1
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
package uinapp
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -18,55 +17,45 @@ func TestGetToken(t *testing.T) {
|
||||
globals.SugarLogger.Debug("result := %v", err)
|
||||
}
|
||||
|
||||
func TestSendMsgAndroid(t *testing.T) {
|
||||
api.SendMsgByUinApp(SendMsgReq{
|
||||
RequestId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||
GroupName: "",
|
||||
Audience: AudienceCid{CId: []string{android}},
|
||||
Settings: SendMsgSetting{},
|
||||
PushMessage: PushMessageDetail{
|
||||
Notification: PushMessageDetailNotification{
|
||||
Title: "测试消息推送[个推推送消息参数]",
|
||||
Body: "吃早饭了没得[个推推送消息参数]",
|
||||
BigText: "这是个什么东西[个推推送消息参数]",
|
||||
BigImage: "",
|
||||
Logo: "",
|
||||
LogoUrl: "",
|
||||
ChannelId: "",
|
||||
ChannelName: "",
|
||||
ChannelLevel: 0,
|
||||
ClickType: "startapp",
|
||||
Intent: "",
|
||||
Url: "",
|
||||
Payload: "",
|
||||
NotifyId: 0,
|
||||
RingName: "",
|
||||
BadgeAddNum: 0,
|
||||
ThreadId: "",
|
||||
func TestCidSend(t *testing.T) {
|
||||
err := api.SendMsgByUinApp(map[string]interface{}{
|
||||
"request_id": "12345237568ydfd2",
|
||||
"settings": map[string]interface{}{
|
||||
"ttl": 7200000,
|
||||
},
|
||||
"audience": map[string]interface{}{
|
||||
"cid": []string{"808ba3cebba05782f82063d590b738a3"},
|
||||
},
|
||||
"push_message": map[string]interface{}{
|
||||
"transmission": "{'type':'new','title':'火车南站店','content':'老板,您来新订单了,请尽快接单!'}",
|
||||
},
|
||||
"push_channel": map[string]interface{}{
|
||||
"android": map[string]interface{}{
|
||||
"ups": map[string]interface{}{
|
||||
"transmission": "厂商透传消息",
|
||||
},
|
||||
},
|
||||
"ios": map[string]interface{}{
|
||||
"type": "notify",
|
||||
"payload": "{'type':'new','title':'火车南站店','content':'老板,您来新订单了,请尽快接单!'}",
|
||||
"aps": map[string]interface{}{
|
||||
"alert": map[string]interface{}{
|
||||
"title": "火车南站店",
|
||||
"body": "新订单",
|
||||
},
|
||||
"content-available": 0,
|
||||
"sound": "自定义铃声,设置为包含后缀名的完整文件名,示例值:ring.mp3",
|
||||
"category": "在客户端通知栏触发特定的action和button显示",
|
||||
},
|
||||
"auto_badge": "+1",
|
||||
"multimedia": []map[string]interface{}{
|
||||
{
|
||||
"url": "https://xxx",
|
||||
"type": 1,
|
||||
"only_wifi": false},
|
||||
},
|
||||
},
|
||||
},
|
||||
PushChannel: PushChannelDetail{
|
||||
//Ios: IosApsDetail{},
|
||||
Android: AndroidPushChannelDetail{Ups: AndroidPushChannelUps{
|
||||
Notification: AndroidPushChannelNotification{
|
||||
Title: "测试消息推送[厂商推送消息参数]",
|
||||
Body: "吃早饭了没得[厂商推送消息参数]",
|
||||
ClickType: "startapp",
|
||||
Intent: "",
|
||||
Url: "",
|
||||
NotifyId: 0,
|
||||
},
|
||||
Transmission: "",
|
||||
Revoke: struct {
|
||||
OldTaskId string `json:"old_task_id"`
|
||||
}{},
|
||||
Options: struct {
|
||||
Constraint string `json:"constraint"`
|
||||
Key string `json:"key"`
|
||||
Value interface{} `json:"value"`
|
||||
}{},
|
||||
}},
|
||||
Mp: MpPushChannelDetail{},
|
||||
},
|
||||
})
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user