Skip to Content
0

Android Push Payload when application in background and gcmNotification doesn't work together

Dec 13, 2017 at 11:56 AM

28

avatar image
Former Member

I send this message to the restnotification service to the Hana Cloud Plattform:

https://mobile- . hana.ondemand.com/restnotification/application/de.company.myapp/

{
 "gcmNotification": {
     "title": "Android Title message",
     "body": "Android Body messages"
    },
   "alert": "Message i see on iOS devices",
   "badge": 1,
   "data": "{'mydata1':'true','mydata2':'more'}"
}

On iOS everything works fine:

1) When the app is in background and the user clicks the notification the app becomes active and ProcessNotification will be triggered.

2) When the app is in foreground ProcessNotification will be triggered.

3) When the app is closed and the user clicks the notification the app starts and ProcessNotification will be triggered.

On Android however:

1) When the app is in background and the user clicks the notification the app becomes active and ProcessNotification will NOT be triggered.

2) When the app is in foreground ProcessNotification will be triggered.

3) When the app is closed and the user clicks the notification the app starts and ProcessNotification will NOT be triggered.

What works:

If i only send this:

{
   "alert": "Message i see on iOS devices",
   "badge": 1,
   "data": "{'mydata1':'true','mydata2':'more'}"
}

Every three points work! It will be triggered even if the app is closed or in the background. But my problem is that i need gcmNotification for the title and the body. Without it the title is always the title from the app.

So my question is, is this a known bug or am i doing something wrong? Thank you in advance!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers