singal offline push

This commit is contained in:
wangchuxiao
2022-06-02 18:17:11 +08:00
parent f98da25fda
commit 16d33b1c1f
19 changed files with 718 additions and 224 deletions
@@ -15,11 +15,17 @@ type Android struct {
Intent struct {
URL string `json:"url,omitempty"`
} `json:"intent,omitempty"`
Extras Extras `json:"extras"`
}
type Ios struct {
Alert string `json:"alert,omitempty"`
Sound string `json:"sound,omitempty"`
Badge string `json:"badge,omitempty"`
Alert string `json:"alert,omitempty"`
Sound string `json:"sound,omitempty"`
Badge string `json:"badge,omitempty"`
Extras Extras `json:"extras"`
}
type Extras struct {
ClientMsgID string `json:"clientMsgID"`
}
func (n *Notification) SetAlert(alert string) {
@@ -29,8 +35,13 @@ func (n *Notification) SetAlert(alert string) {
n.IOS.Alert = alert
n.IOS.Sound = "default"
n.IOS.Badge = "+1"
}
func (n *Notification) SetExtras(extras Extras) {
n.IOS.Extras = extras
n.Android.Extras = extras
}
func (n *Notification) SetAndroidIntent() {
n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent
}