Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xxgail committed Nov 19, 2020
1 parent 20e7829 commit cd2dd70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# PushSDK
[![PkgGoDev](https://pkg.go.dev/badge/github.com/xxgail/PushSDK)](https://pkg.go.dev/github.com/xxgail/PushSDK)

Go-PushSDK
给APNS发推送消息。包括iOS、华为、小米、魅族、OPPO、vivo

Expand All @@ -9,6 +11,7 @@ Go-PushSDK
`go get github.com/xxgail/PushSDK`



- [builder.go](https://github.com/xxgail/PushSDK/blob/master/builder.go) 构建消息体
- [common.go](https://github.com/xxgail/PushSDK/blob/master/common.go) 包内的公共方法
- [const.go](https://github.com/xxgail/PushSDK/blob/master/const.go) 定义常量
Expand All @@ -17,6 +20,7 @@ Go-PushSDK
- [result_common.go](https://github.com/xxgail/PushSDK/blob/master/result_common.go) 返回格式
- [send.go](https://github.com/xxgail/PushSDK/blob/master/send.go) sendMessage主体步骤


# example
```go
package main
Expand All @@ -40,6 +44,8 @@ func main() {
}

```


# channel-param
| **channel** | **plat** |
| --- | --- |
Expand All @@ -50,6 +56,8 @@ func main() {
| oppo | {"app_key":"xxx","master_secret":"xxx"} |
| vivo | {"app_id":"xxx","app_key":"xxx","app_secret":"xxx"} |



# 具体传输方式
| **channel** | **device_token来源** | **请求方式** | **URL** | **Content-Type** | **request-header** | **消息体结构** | **device_token位置** |
| --- | --- | --- | --- | --- | --- | --- | --- |
Expand All @@ -61,5 +69,7 @@ func main() {
| vivo| regId | POST| [https://api-push.vivo.com.cn](https://api-push.vivo.com.cn)/message/send | application/json | "authToken" = authToken | json格式 | 在json消息体中 |



# 参考来源
> ios- Local and Remote Notification Programming Guide [https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1)
> Local and Remote Notification Programming Guide [https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1)
> hw推送服务-HTTPS下行消息 [https://developer.huawei.com/consumer/cn/doc/HMSCore-References-V5/https-send-api-0000001050986197-V5#ZH-CN_TOPIC_0000001050986197__section723545214380](https://developer.huawei.com/consumer/cn/doc/HMSCore-References-V5/https-send-api-0000001050986197-V5#ZH-CN_TOPIC_0000001050986197__section723545214380)
2 changes: 1 addition & 1 deletion oppo_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (o *OPPO) initMessage(m *Message, registrationIds []string) map[string]stri
AppMessageId: m.ApnsId,
Style: 1,
Title: m.Title,
SubTitle: m.Title,
SubTitle: "",
Content: m.Desc,
ClickActionType: clickTypeOPPO[m.ClickType],
ClickActionActivity: m.ClickContent,
Expand Down

0 comments on commit cd2dd70

Please sign in to comment.