Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Use fallback method for extras.getString: add "gcm.notification." prefix #102

Merged
merged 1 commit into from Sep 7, 2015

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Sep 4, 2015

Hi,

I don't know exactly why but when receiving a push noitification sent with this command:

curl --header "Authorization: key=x" \
     --header Content-Type:"application/json" \
     https://gcm-http.googleapis.com/gcm/send \
     -d '{
    "to": "s",
    "priority":"high",
    "message" : "test",
    "body":"body",
    "hahaha":"test",
    "notification": {
        "title": "Stample title notif",
        "message" : "test",
        "body":"body",
        "hahaha":"test"
     }
}'

The Bundle I receive on onMessage is:

extras=Bundle[{
gcm.notification.title=Stample title notif, 
gcm.notification.hahaha=test, 
from=345598564729, 
gcm.notification.message=test, 
gcm.notification.body=body, 
collapse_key=do_not_collapse, 
foreground=false}
]

And when you query the Bundle, you don't use the "gcm.notification".

Thus background notifications are never received because the message is detected to be null and createNotification is never called.

This maybe solves issue: #101

Is this prefix newly added iin GCM? because I've seen it in your code but not everywhere so maybe you forgot to use it in this case

macdonst added a commit that referenced this pull request Sep 7, 2015
Use fallback method for extras.getString: add "gcm.notification." prefix
@macdonst macdonst merged commit 35155b1 into phonegap:master Sep 7, 2015
@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants