cordova-plugin-push-notification
cordova-plugin-push-notification copied to clipboard
Android 6 support
App was crashing when receiving notifications while in background.
With this fix "large_icon.png" and "small_icon.png" (24x24 px / white on alpha) MUST be present in resources/drawable
How would I specify what icon to use for push notifications? I recently realized lollipop and above make non transparent pixels white. Thus I made an appropriate icon but I do not know how to make this plugin use that icon. Any suggestions? Thanks for any help.
If you check out my fork you can just just put a 24x24px white-on-transparent png named "small_icon.png" and a 72x72px png named "large_icon.png" in "platforms/android/res/drawable" folder.
small_icon.png should appear in the top bar when notification is received, and large_icon.png in the notifications list when you drag down the top bar.
For further hacking see src/android/com/plugin/gcm/GCMIntentService.java line 147 and 159:
return context.getResources().getIdentifier("small_icon", "drawable", context.getPackageName());
...
return context.getResources().getIdentifier("large_icon", "drawable", context.getPackageName());