Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(local-notifications): support for icon background color (#1079)
The Cordova plugin Ionic Natives uses allows specifying the background color of the smallIcon. By not including it in your interface you force users to use the default color for their version of Android. While the LocalNotification plugin is not well documented, it does include this feature, see Options.java line 253: ``` /** * @return * The notification background color for the small icon * Returns null, if no color is given. */ public int getColor() { String hex = options.optString("color", null); if (hex == null) { return NotificationCompat.COLOR_DEFAULT; } int aRGB = Integer.parseInt(hex, 16); return aRGB + 0xFF000000; } ``` I've simply added the option to the interface as well as a short description. This lets you go from the default color (varies by Android version): https://goo.gl/photos/nERcj4GZgapy8aee9 To any color you'd like: https://goo.gl/photos/t8V9WVba8jDU49aHA And also works if you also specify a large icon: https://goo.gl/photos/gWQYwa12djmdXfYcA
- Loading branch information