Files
baseapi/platformapi/uinapp/uin_app_test.go
邹宗楠 3dc6ffe0d7 1
2023-03-20 16:13:35 +08:00

62 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package uinapp
import (
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"testing"
)
var (
api = NewUinappApi(appId, appKey, appSecret, masterSecret)
ios = "22d3c42f10cab7765c04ee5aee5ba068"
android = "747bda2a61059284405e32a575a03c8f"
)
func TestGetToken(t *testing.T) {
err := api.GetUinAppToken()
globals.SugarLogger.Debug("result := %v", err)
}
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},
},
},
},
})
fmt.Println(err)
}