Skip to content

Commit 1f15285

Browse files
author
施凯伦
committed
remove msg uniqueiid filed
1 parent 712d2d5 commit 1f15285

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ func (m *MiPush) defaultForm(msg *Message) url.Values {
694694
if msg.TimeToSend > 0 {
695695
form.Add("time_to_send", strconv.FormatInt(int64(msg.TimeToSend), 10))
696696
}
697-
if msg.Extra != nil && len(msg.Extra) > 0 {
697+
if len(msg.Extra) > 0 {
698698
for k, v := range msg.Extra {
699699
form.Add("extra."+k, v)
700700
}

constants.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package xiaomipush
22

33
const (
44
ProductionHost = "https://api.xmpush.xiaomi.com"
5-
SandboxHost = "https://sandbox.xmpush.xiaomi.com" // iOS supported only
65
)
76

87
const (

message.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
type Message struct {
1111
RestrictedPackageName string `json:"restricted_package_name,omitempty"` // 设置app的多包名packageNames(多包名发送广播消息)。p
12-
UniqueID string `json:"unique_id,omitempty,omitempty"` // 消息唯一ID
1312
Payload string `json:"payload,omitempty"` // 消息内容payload
1413
Title string `json:"title,omitempty"` // 通知栏展示的通知的标题
1514
Description string `json:"description,omitempty"` // 通知栏展示的通知的描述
@@ -31,11 +30,6 @@ func (m *Message) SetRestrictedPackageName(restrictedPackageNames []string) *Mes
3130
return m
3231
}
3332

34-
func (m *Message) SetUniqueID(uniqueID string) *Message {
35-
m.UniqueID = uniqueID
36-
return m
37-
}
38-
3933
func (m *Message) SetPassThrough(passThrough int32) *Message {
4034
m.PassThrough = passThrough
4135
return m
@@ -91,7 +85,6 @@ func (m *Message) SetJobKey(jobKey string) *Message {
9185
// 小米推送服务器每隔1s将已送达或已点击的消息ID和对应设备的regid或alias通过调用第三方http接口传给开发者。
9286
func (m *Message) SetCallback(callbackURL string) *Message {
9387
m.Extra["callback"] = callbackURL
94-
m.Extra["callback.param"] = m.UniqueID
9588
m.Extra["callback.type"] = "3" // 1:送达回执, 2:点击回执, 3:送达和点击回执
9689
return m
9790
}
@@ -114,7 +107,6 @@ func (m *Message) JSON() []byte {
114107
// 发送给Android设备的Message对象
115108
func NewAndroidMessage(title, description string) *Message {
116109
return &Message{
117-
UniqueID: "",
118110
Payload: "",
119111
Title: title,
120112
Description: description,
@@ -156,7 +148,6 @@ func (m *Message) SetPayload(payload string) *Message {
156148
// 发送给IOS设备的Message对象
157149
func NewIOSMessage(description string) *Message {
158150
return &Message{
159-
UniqueID: "",
160151
Payload: "",
161152
Title: "",
162153
Description: description,

0 commit comments

Comments
 (0)