support go goroutines.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-04-03 16:48:08 +08:00
parent 08a5493e4f
commit 7002c4008c
1 changed files with 3 additions and 7 deletions

View File

@ -115,24 +115,20 @@ func InitAPNSClient() error {
}
func pushNotification(notification RequestPushNotification) bool {
var (
success bool
)
switch notification.Platform {
case PlatFormIos:
if !PushConf.Ios.Enabled {
return false
}
success = pushNotificationIos(notification)
go pushNotificationIos(notification)
case PlatFormAndroid:
if !PushConf.Android.Enabled {
return false
}
success = pushNotificationAndroid(notification)
go pushNotificationAndroid(notification)
}
return success
return true
}
// The iOS Notification Payload