Android: Set request message if body is empty

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-03-25 23:50:32 +08:00
parent 79dace4485
commit 5941373bae
1 changed files with 4 additions and 2 deletions

View File

@ -232,8 +232,10 @@ func pushNotificationAndroid(req RequestPushNotification) bool {
notification.Notification = &req.Notification
// overwrite notification body
// Set request message if body is empty
if len(notification.Notification.Body) == 0 {
notification.Notification.Body = req.Message
}
res, err := gcm.SendHttp("api key", notification)