Cordova PushNotification Icon for Android 5.0 and above versions
Posted By : Pankaj Kumar Yadav | 29-Jun-2016
Hi all,
This blog is for PushNotification Icon in Android 5 and above versions (phonegap).
Android includes support for material design apps and provide following elements to build Meterial design: -
New theme, New widgets for complex views, New APIs for custom shadows and animations.
So due to material design, pushNotification icon shows blank.
To resolve above issue in phonegap apps, follow the steps:
1: - Add plugin "phonegap-plugin-push"
2: - Need a transparent icon.
3: - Create a folder with name "drawable" inside res folder if not exists and put transparent icon.
4: - Now in PushNotification config, specify the icon name and background color, for Example -
var push = PushNotification.init({ android: { senderID: "xxxxxxxxxxx", iconColor:"icon_background_color", icon:"icon_name" }, ios: { alert: "true", badge: "true", sound: "true", clearBadge:"true" }, windows: {} });
Here are some links for more
https://developer.android.com/design/material/index.html,
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md
Thanks
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Pankaj Kumar Yadav
Pankaj has been working as a Grails developer expertise in struts, spring, ejb, hibernate and angularjs framework.