Verified Commit d0c36b6f authored by Cui's avatar Cui

delete useless code

parent bcf51fbb
......@@ -2,6 +2,7 @@ package sender
import (
"encoding/json"
"reflect"
"github.com/sirupsen/logrus"
......@@ -57,39 +58,16 @@ func AppMessageSender(am AppMessage, appKey, masterSecret string, iosProduction
// Options 的 Validate 方法会对 big_push_duration 属性做范围限制,以满足 JPush 的规范
// options.BigPushDuration = 1500
if am.Extra.MessageId != "" {
androidNotification.AddExtra("messageId", am.Extra.MessageId)
iosNotification.AddExtra("messageId", am.Extra.MessageId)
}
v := reflect.ValueOf(am.Extra)
for i := 0; i < v.NumField(); i++ {
tag := v.Type().Field(i).Tag.Get("json")
androidNotification.AddExtra("noticeType", am.Extra.NoticeType)
androidNotification.AddExtra("jumpType", am.Extra.JumpType)
androidNotification.AddExtra("jumpPage", am.Extra.JumpPage)
androidNotification.AddExtra("jumpUrl", am.Extra.JumpUrl)
androidNotification.AddExtra("jumpTag", am.Extra.JumpTag)
androidNotification.AddExtra("jumpText", am.Extra.JumpText)
androidNotification.AddExtra("ShareId", am.Extra.ShareId)
androidNotification.AddExtra("channelId", am.Extra.ChannelId)
androidNotification.AddExtra("channelGroupId", am.Extra.ChannelGroupId)
androidNotification.AddExtra("projectId", am.Extra.ProjectId)
androidNotification.AddExtra("productId", am.Extra.ProductId)
iosNotification.AddExtra("noticeType", am.Extra.NoticeType)
iosNotification.AddExtra("jumpType", am.Extra.JumpType)
iosNotification.AddExtra("jumpPage", am.Extra.JumpPage)
iosNotification.AddExtra("jumpUrl", am.Extra.JumpUrl)
iosNotification.AddExtra("jumpTag", am.Extra.JumpTag)
iosNotification.AddExtra("jumpText", am.Extra.JumpText)
iosNotification.AddExtra("ShareId", am.Extra.ShareId)
iosNotification.AddExtra("channelId", am.Extra.ChannelId)
iosNotification.AddExtra("channelGroupId", am.Extra.ChannelGroupId)
iosNotification.AddExtra("projectId", am.Extra.ProjectId)
iosNotification.AddExtra("productId", am.Extra.ProductId)
androidNotification.AddExtra("unReadCount", am.Extra.UnReadCount)
iosNotification.AddExtra("unReadCount", am.Extra.UnReadCount)
if tag != "" {
androidNotification.AddExtra(tag, v.Field(i).Interface())
iosNotification.AddExtra(tag, v.Field(i).Interface())
}
}
payload := push.NewPushObject()
payload.Platform = platform
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment