notification modify

pull/103/head
Gordon 3 years ago
parent 4b13874d44
commit 85a75be30e

@ -21,6 +21,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin
au.SetAlias(accounts) au.SetAlias(accounts)
var no requestBody.Notification var no requestBody.Notification
no.SetAlert(content) no.SetAlert(content)
no.SetAndroidIntent()
var me requestBody.Message var me requestBody.Message
me.SetMsgContent(detailContent) me.SetMsgContent(detailContent)
var po requestBody.PushObj var po requestBody.PushObj

@ -1,5 +1,7 @@
package requestBody package requestBody
const INTENT_URL = "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end"
type Notification struct { type Notification struct {
Alert string `json:"alert,omitempty"` Alert string `json:"alert,omitempty"`
Android *Android `json:"android,omitempty"` Android *Android `json:"android,omitempty"`
@ -7,11 +9,14 @@ type Notification struct {
} }
type Android struct { type Android struct {
Intent string `json:"intent,omitempty"`
} }
type Ios struct { type Ios struct {
} }
func (n *Notification) SetAlert(alert string) { func (n *Notification) SetAlert(alert string) {
n.Alert = alert n.Alert = alert
} }
func (n *Notification) SetAndroidIntent() {
n.Android.Intent = INTENT_URL
}

Loading…
Cancel
Save