Skip to content

Commit

Permalink
Merge 35be7ee into c1d5e9a
Browse files Browse the repository at this point in the history
  • Loading branch information
jostyee committed Mar 1, 2017
2 parents c1d5e9a + 35be7ee commit 4e1bd0b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions model/push_notification.go
Expand Up @@ -42,14 +42,13 @@ func (me *PushNotification) ToJson() string {
b, err := json.Marshal(me)
if err != nil {
return ""
} else {
return string(b)
}

return string(b)
}

func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) {

parts := strings.Split(deviceId, ":")
parts := strings.SplitN(deviceId, ":", 2)
if len(parts) == 2 {
me.Platform = parts[0]
me.DeviceId = parts[1]
Expand All @@ -62,7 +61,7 @@ func PushNotificationFromJson(data io.Reader) *PushNotification {
err := decoder.Decode(&me)
if err == nil {
return &me
} else {
return nil
}

return nil
}

0 comments on commit 4e1bd0b

Please sign in to comment.