feat: check unused package (#232)

* feat: check unused package

update edganiukov/fcm to appleboy/go-fcm

* update readme

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update comment

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-06-01 02:52:01 -05:00
committed by GitHub
parent 77bce18c9f
commit 14dc899b02
42 changed files with 47 additions and 2661 deletions

View File

@@ -10,7 +10,7 @@ import (
"sync"
"time"
"github.com/edganiukov/fcm"
"github.com/appleboy/go-fcm"
apns "github.com/sideshow/apns2"
"github.com/sideshow/apns2/certificate"
"github.com/sideshow/apns2/payload"
@@ -131,7 +131,7 @@ func CheckMessage(req PushNotification) error {
return errors.New(msg)
}
// ref: https://developers.google.com/cloud-messaging/http-server-ref
// ref: https://firebase.google.com/docs/cloud-messaging/http-server-ref
if req.Platform == PlatFormAndroid && req.TimeToLive != nil && (*req.TimeToLive < uint(0) || uint(2419200) < *req.TimeToLive) {
msg = "the message's TimeToLive field must be an integer " +
"between 0 and 2419200 (4 weeks)"
@@ -456,7 +456,7 @@ Retry:
// GetAndroidNotification use for define Android notification.
// HTTP Connection Server Reference for Android
// https://developers.google.com/cloud-messaging/http-server-ref
// https://firebase.google.com/docs/cloud-messaging/http-server-ref
func GetAndroidNotification(req PushNotification) *fcm.Message {
notification := &fcm.Message{
To: req.To,

View File

@@ -7,9 +7,9 @@ import (
"testing"
"time"
"github.com/appleboy/go-fcm"
"github.com/appleboy/gorush/config"
"github.com/buger/jsonparser"
"github.com/edganiukov/fcm"
"github.com/sideshow/apns2"
"github.com/stretchr/testify/assert"
)