-
Notifications
You must be signed in to change notification settings - Fork 1.9k
App crashes on notification when in background #715
Comments
Which version of plugin? what device (Samsung, HTC, ...?) |
Plugin v1.6.0 Sony Xperia Z3 Compact (Android 5.1.1) |
@HanGmanXXL run |
Hi, I got the same problem ; send a notification, if the app is open and front, all is ok, if the app is collapsed or closed, I got an error popup "The application has been closed". I launch adb logcat, and this is the output generated when a notification is received : I try on a Nexus 4, and the notification is send followed the example provided here (with node) :/ Cordova v6.0.1, Plugin v1.6.0 too Thanks ! EDIT Ok, I cannot really fix it because I'm not a Java-man, but the error comes from "setNotificationIconColor" function. I read the code and see the try catch :
But it seems that the error is not a "IllegalArgumentException" in my case... |
@wibimaster can you post up your PushNotification.init and a sample push payload as well? Your bug is a really easy fix but I just want to make sure it is the same repo as @HanGmanXXL |
I try many things, an example of init used (tried with "iconColor: ''" too):
And same symptoms with all examples provided here, as this one (tried with a simple title + message notification too) :
|
@HanGmanXXL okay, I've fixed this and published version 1.6.1 which is now available on NPM. Thanks for the excellent bug report. |
Perfect ! It works great, many thanks 👍 |
So does this error always occur, or only when trying to set the icon? (Need to know if I need to push out a new release for Android) |
@barryvdh it only happens when you set So as long as you are not setting |
@macdonst Sorry for the late response. Thank you very much for fixing it so quickly. 👍 |
@HanGmanXXL no problem, I love good bug reports that I can actually reproduce. |
This thread has been automatically locked. |
Actual Behaviour
The App crashes on notification, when in background. In App its all fine and works properly.
Receiving notifications when app is in background worked already but at a moments notice it stopped working.
Platform and Version
Android 6.0.1 - Nexus 5x
Android 5.1.1 - Sony Xperia Z3 Compact
Cordova v6.0.0
Plugin v1.6.0
Sample Push Data Payload
Sample Code that illustrates the problem
I don't know how to debug this kind of crash.
Thanks for your support!
The text was updated successfully, but these errors were encountered: