Android: Set request message if body is empty
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -232,8 +232,10 @@ func pushNotificationAndroid(req RequestPushNotification) bool {
|
|||||||
|
|
||||||
notification.Notification = &req.Notification
|
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
|
notification.Notification.Body = req.Message
|
||||||
|
}
|
||||||
|
|
||||||
res, err := gcm.SendHttp("api key", notification)
|
res, err := gcm.SendHttp("api key", notification)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user