From 81a97c55a669539b6b1e13c10832320cc541db47 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期二, 18 八月 2020 15:20:09 +0800 Subject: [PATCH] add ios msg push --- service/msgPush.go | 38 +++++++++++++++++++++++++++----------- 1 files changed, 27 insertions(+), 11 deletions(-) diff --git a/service/msgPush.go b/service/msgPush.go index 27d1201..6e52527 100644 --- a/service/msgPush.go +++ b/service/msgPush.go @@ -446,6 +446,30 @@ } url := baseUrl+"/push/all" intent := "intent:#Intent;action=android.intent.action.oppopush;launchFlags=0x14000000;component=uni.UNIEDF0B5C/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title="+title+";S.content="+msg+";S.payload=test;end" + androidPush := map[string]map[string]map[string]string { + "ups": { + "notification": { + "title": title, + "body": msg, + "click_type": "intent", + "intent": intent, + }, + }, + } + iosPush := map[string]interface{}{ + "type":"notify", + "payload":"鑲茶嫳涓鍋滆溅", + "aps":map[string]interface{}{ + "alert":map[string]string{ + "title": title, + "body": msg, + }, + "content-available":0, + //"sound":"com.gexin.ios.silence", + //"category":"ACTIONABLE", + }, + "auto_badge":"+1", + } reqBody := map[string]interface{} { "request_id": time.Now().Format("20060102150405") + util.GenValidateCode(6), "settings":map[string]int { @@ -460,17 +484,9 @@ "intent": intent, }, }, - "push_channel": map[string]map[string]map[string]map[string]string { - "android": { - "ups": { - "notification": { - "title": title, - "body": msg, - "click_type": "intent", - "intent": intent, - }, - }, - }, + "push_channel": map[string]interface{} { + "android": androidPush, + "ios": iosPush, }, } header := map[string]string { -- Gitblit v1.8.0