[Question] How do I set a custom icon for the notification?
See original GitHub issueI am trying to set up a custom icon so it no longer shows the white square, but I can’t seem to get it to target a new icon. How do i include more icons in my project and aim this plugin to use a new icon?
I tried adding <resource-file src="img_res/icons/android/icon_noti.png" target="res/drawable/iconnoti.png" />
to my config
<platform name="android">
<resource-file src="img_res/icons/android/icon_noti.png" target="res/drawable/iconnoti.png" />
<icon density="ldpi" src="img_res/icons/android/ldpi.png" />
<icon density="mdpi" src="img_res/icons/android/mdpi.png" />
<icon density="hdpi" src="img_res/icons/android/hdpi.png" />
<icon density="xhdpi" src="img_res/icons/android/xhdpi.png" />
<icon density="xxhdpi" src="img_res/icons/android/xxhdpi.png" />
<icon density="xxxhdpi" src="img_res/icons/android/xxxhdpi.png" />
<splash density="port-ldpi" src="img_res/screens/android/splash-port-ldpi.png" />
<splash density="port-mdpi" src="img_res/screens/android/splash-port-mdpi.png" />
<splash density="port-hdpi" src="img_res/screens/android/splash-port-hdpi.png" />
<splash density="port-xhdpi" src="img_res/screens/android/splash-port-xhdpi.png" />
<splash density="port-xxhdpi" src="img_res/screens/android/splash-port-xxhdpi.png" />
<splash density="port-xxxhdpi" src="img_res/screens/android/splash-port-xxxhdpi.png" />
</platform>
And using it like this
cordova.plugins.backgroundMode.setDefaults({
resume: true,
hidden: false,
bigText: false,
icon:'iconnoti'
});
When I search the platforms folder, it did add the icon to the drawable folder. But I still get the white square. I tried different icons, black on transparent, white on transparent, xxxhdpi size, ldpi size, but always a white square.
I’m a bit lost on this. I don’t want to lose the colour icon in the launcher. How do I add an extra icon to the app, and have the plugin use the icon?
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Android: Notification Icons - OneSignal Documentation
Navigate to Messages > New Push > Platform Settings > Google Android Options > Set the icon name without the file extension. With...
Read more >How do I manage my Canvas notification settings as a student?
Each notification is set to a default setting. To change a notification for a contact method, locate the notification and click the icon...
Read more >iOS 15 Custom Icons - No Banners / No Notifications ...
iOS 15 Custom Icons - No Banners / No Notifications Automation Method UpdateHow to create the custom iOS 15 icons ? see this ......
Read more >How To Change App Icons on iPhone iOS 16 [NO ... - YouTube
How To Change App Icons on iPhone iOS 16 [NO NOTIFICATION ]. Watch later. Share. Copy link. Info. Shopping. Tap to unmute.
Read more >Customize the taskbar notification area - Microsoft Support
To change how icons and notifications appear. Press and hold or right-click any empty space on the taskbar and select Taskbar settings. Under...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Update for Cordova Android 7.1’s new file layout
Duplicate those resource lines for every additional icon you need.
Also this plugin is a little bit dead. Try this fork https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ Currently working on android X support