cordova-plugin-push-notification icon indicating copy to clipboard operation
cordova-plugin-push-notification copied to clipboard

Android 6 support

Open subaddiction opened this issue 8 years ago • 2 comments

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

subaddiction avatar Apr 08 '16 12:04 subaddiction

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.

tonyneel923 avatar Oct 06 '16 00:10 tonyneel923

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());

subaddiction avatar Oct 09 '16 12:10 subaddiction