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

Data Payload Does Not Work #2020

Closed
nprail opened this issue Oct 18, 2017 · 5 comments
Closed

Data Payload Does Not Work #2020

nprail opened this issue Oct 18, 2017 · 5 comments

Comments

@nprail
Copy link

nprail commented Oct 18, 2017

Expected Behaviour

When I send a notification with the data payload, the device should receive a notification.

Actual Behaviour

When I send a notification with a payload like this:

{
    "data" : {
        "title": "Test Notification",
        "body": "This offer expires at 11:30 or whatever",
        "notId": 10,
        "surveyID": "ewtawgreg-gragrag-rgarhthgbad"
    }
}

It never shows up. While if I use the notification payload, it shows up but with the wrong icon as mentioned in #1924.

Steps to Reproduce

Basically send a notification to an Android device with a data payload instead of notification payload.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

  • Android 8.0

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

  • Google (LG) Nexus 5X

Cordova CLI version and cordova platform version

  • Cordova CLI: 7.0.1
  • Cordova Android: 6.2.3

Plugin version

2.0.0

Sample Push Data Payload

{
    "data" : {
        "title": "Test Notification",
        "body": "This offer expires at 11:30 or whatever",
        "notId": 10,
        "surveyID": "ewtawgreg-gragrag-rgarhthgbad"
    }
}

Sample Code that illustrates the problem

N/A

Logs taken while reproducing problem

Will add soon...

@macdonst
Copy link
Member

@nprail I think you may be running into #1949. Can you check to see what the targetSdkVersion version is in your AndroidManifest.xml? If it is 26 then you'll need to install the push plugin from master. The fix will be in 2.1.0 which I will release this week. Lemme know.

@nprail
Copy link
Author

nprail commented Oct 18, 2017

@macdonst I am using Android SDK 26. I'll try the fix out! Thanks!

@macdonst
Copy link
Member

@nprail well, crap. Sorry I did not realize that sooner. Targeting Android 26 means you have to have a MessagingChannel. The 2.1.0 version of the plugin will create a default one for you or allow you to specify channels. I'm not 100% happy with the way I've implemented that and I'm spending some time cleaning it up today.

However, that shouldn't stop you from verifying that things work with the code out of master.

@nprail
Copy link
Author

nprail commented Oct 18, 2017

@macdonst Hey! It actually worked! Thanks a lot!

@nprail nprail closed this as completed Oct 18, 2017
@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.
Development

No branches or pull requests

2 participants