New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 7, 2015

Conversation

Projects
None yet
2 participants
@slorber
Contributor

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

Merge pull request #102 from slorber/master
Use fallback method for extras.getString: add "gcm.notification." prefix

@macdonst macdonst merged commit 35155b1 into phonegap:master Sep 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lock

This comment has been minimized.

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.