diff options
Diffstat (limited to 'model/push_notification.go')
-rw-r--r-- | model/push_notification.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/model/push_notification.go b/model/push_notification.go index c426e01e5..753495b2f 100644 --- a/model/push_notification.go +++ b/model/push_notification.go @@ -49,10 +49,11 @@ func (me *PushNotification) ToJson() string { func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) { - parts := strings.Split(deviceId, ":") - if len(parts) == 2 { - me.Platform = parts[0] - me.DeviceId = parts[1] + index := strings.Index(deviceId, ":") + + if index > -1 { + me.Platform = deviceId[:index] + me.DeviceId = deviceId[index+1:] } } |