-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Unexpected / Broken Android Behavior #767
Comments
First I don't think what is documented here has anything to do with #746 and #747. That has to do with the OS takes over and does not call GCMIntentService.onMessageReceived() when you use the "notification" area of the push payload. This is explained in great detail in this issue in GCM's repo: google/gcm#63. I have tried to reproduce this problem and I cannot. I've tested on the following devices:
The method that I'm using to test is a node-gcm script: var gcm = require('node-gcm');
// Replace these with your own values.
var apiKey = "replace with API key";
var deviceID = "my device id";
var service = new gcm.Sender(apiKey);
var message = new gcm.Message();
message.addData('message', 'This is a test message');
service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) {
if(err) console.error(err);
else console.log(response);
}); I am getting the My test environment is:
The only difference is my Android SDK Build tools is version |
Just to document my investigation, it appears the build-tools is not to blame here, I was able to have a working version using the latest SDK, but using an older After updating the |
Update 2: solution Following up on the previous installations and compatibility, it appears that there is an underlying compatibility issue with some of the installed SDK packages (probably not even necessarily a bug but more something is choosing the wrong version as there are likely multiple). I've come to this conclusion after multiple tests of packages and installations, and cannot reproduce the issues with a clean install of the SDK with the minimum required packages to build the app with the plugin: I recommend anyone else having similar issues to do a fresh install and I am considering this closed as there does not appear to be anything wrong with the plugin directly. |
This thread has been automatically locked. |
A series of strange behavior crops up with Android notifications. I believe the following (and possibly others that I have missed) all directly stem from an update of the Android SDK:
#724
#746
#747
I've not yet narrowed down what lib specifically causes the issues to crop up, nor have I determined if the root cause lies within the plugin code or the SDK itself. I am opening this so that we can move the related issues discussions to a single location and gather more information / tests to narrow down the root issue.
I believe this is likely related to the build-tools specifically, but I have not confirmed just yet.The following are my installed libs with their versions where the problems exist:I believe my libs were pre marshmallow support before I updated, but I stupidly did not take a screenshot of my versions pre-updating so I will try to get versions from a working setup to post as well.
Reproduce Scenario (including but not limited to)
Update Android SDK libraries and compile the plugin.
Steps to Reproduce
android
to update SDK librariesonNotification
handler of the plugin.onNotification
callback is not fired. (the other issues listed above can be experienced as well)Platform and Version (eg. Android 5.0 or iOS 9.2.1)
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Does not appear to be vendor specific, but I have experienced this on a Oneplus One.
Cordova CLI version and cordova platform version
(likely not dependent, but not necessarily)
Plugin version
Sample Push Data Payload
Sample Code that illustrates the problem
n/a
Logs taken while reproducing problem
Plugin logs:
The text was updated successfully, but these errors were encountered: