From 7f55bf7ecc2831935945e53e2b1dc31d9a2403fe Mon Sep 17 00:00:00 2001 From: Niko Filippidis <11477309+filikos@users.noreply.github.com> Date: Thu, 9 Sep 2021 22:32:10 +0200 Subject: [PATCH] Removed not used type --- sdk/push.go | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sdk/push.go b/sdk/push.go index 83695a7..c08a84f 100644 --- a/sdk/push.go +++ b/sdk/push.go @@ -6,18 +6,15 @@ import ( "strings" ) -// ExponentPushToken is a valid Expo push token -type ExponentPushToken string - // ErrMalformedToken is returned if a token does not start with 'ExponentPushToken' var ErrMalformedToken = errors.New("Token should start with ExponentPushToken") //NewExponentPushToken returns a token and may return an error if the input token is invalid -func NewExponentPushToken(token string) (ExponentPushToken, error) { +func NewExponentPushToken(token string) (string, error) { if !strings.HasPrefix(token, "ExponentPushToken") { return "", ErrMalformedToken } - return ExponentPushToken(token), nil + return token, nil } const ( @@ -52,16 +49,16 @@ const ( // ChannelID: ID of the Notification Channel through which to display this // notification on Android devices. type PushMessage struct { - To []ExponentPushToken `json:"to"` - Body string `json:"body"` - Data map[string]string `json:"data,omitempty"` - Sound string `json:"sound,omitempty"` - Title string `json:"title,omitempty"` - TTLSeconds int `json:"ttl,omitempty"` - Expiration int64 `json:"expiration,omitempty"` - Priority string `json:"priority,omitempty"` - Badge int `json:"badge,omitempty"` - ChannelID string `json:"channelId,omitempty"` + To []string `json:"to"` + Body string `json:"body"` + Data map[string]string `json:"data,omitempty"` + Sound string `json:"sound,omitempty"` + Title string `json:"title,omitempty"` + TTLSeconds int `json:"ttl,omitempty"` + Expiration int64 `json:"expiration,omitempty"` + Priority string `json:"priority,omitempty"` + Badge int `json:"badge,omitempty"` + ChannelID string `json:"channelId,omitempty"` } // Response is the HTTP response returned from an Expo publish HTTP request @@ -90,7 +87,7 @@ const ErrorMessageRateExceeded = "MessageRateExceeded" // 'message': '"adsf" is not a registered push notification recipient'} type PushResponse struct { PushMessage PushMessage - ID string `json:"id"` + ID string `json:"id"` Status string `json:"status"` Message string `json:"message"` Details map[string]string `json:"details"`