This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Custom notification icon for android + documentation #2487
Comments
@charlesverge a couple of things for you to double check. First, it sounds like you are running into the Notification vs Data Payload issue. You'll need to put everything in Second, make sure your icon has some transparent pixels or you will get that grey square. The final bit about paths being incorrect, is a docs bug. Thanks for bringing it to my notice. |
@charlesverge what is the correct image path for cordova 8? |
@maitscha i just fixed this in my app by doing this:
then in the init of this plugin add
hope this helps (Anyone) ATTENTION:
|
macdonst
added a commit
that referenced
this issue
Aug 17, 2018
This thread has been automatically locked. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behaviour
Use custom notification icon when application in background.
Actual Behaviour
Uses default icon which is a gray square on Android 7 due to not using custom icon for notifications
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Create app with platform android 7.1.0 phonegap 8.0.0
PushNotification.init({
android: {
"icon": "notification_icon",
},
ios: {
alert: "true",
badge: "true",
sound: "false"
},
windows: {}
});
Send notification to app over firebase
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 7.1.1
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Motorola 6
Cordova CLI version and cordova platform version
Plugin version
Sample Push Data Payload
[
'token' => $deviceToken,
'notification' => [
'title' => $title,
'body' => $body,
]
]
Sample Code that illustrates the problem
Logs taken while reproducing problem
No logs are produced
Workaround
Currently the work around is to
[
'token' => $deviceToken,
'notification' => [
'title' => $title,
'body' => $body,
'icon' => 'notification_icon',
],
'android' => [
'ttl' => '3600s',
'priority' => 'normal',
'notification' => [
'icon' => 'notification_icon',
],
],
Note if the path used in the documentation is used (platforms/android/res/drawable/phonegap.png) then this will cause phonegap 8.0.0/cordova-android 7.0.0 to break with a file not found error
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#images
The text was updated successfully, but these errors were encountered: