Android 6 Unity 5.. Push notification icon

0 votes

The actual plugin is not showing the icon on Android 6 with unity 5 on the notificatoin tab upper part of the device (only if you hold the notification or tap the I button), but it shows perfectly on the lock screen.

The icon is copied to re/drawable as app_icon as the plugin needs to, but the icon on notificaiton is a white blank square. How do I change it to work on all the notification in android 6?

asked Feb 23, 2016 in Unity by leandro.gameprog (10 points)
edited Feb 23, 2016 by leandro.gameprog

1 Answer

0 votes

Hi Leandro,

We have provided plugin source with the attached Sample, you can modify App42GCMService.java file according to your requirements and enhance Notification UI.

You can build the jar file with the plugin source and replace the same in Android folder of your Unity project.

By default plugin shows the application icon name as app_icon from drawable folder.

 

Let me know if you face any issue in customization.

 

Thanks

Vishnu Garg

answered Feb 24, 2016 by Vishnu Garg (674 points)
Yeah I saw the change logs for the lollipop and marshmellow and modified a little the script to accept work with both, preveious android versions and recent ones.
I changed the notification icon to get a different one if it dected running a device with lollipop installed.
The only problem I had was to integrate assets inside the "asset" folder, since it was not really being copied.. I had to change the folder inside Unity 5 to res/drawable so unity could copy it to staging.
If you want to do it from assets folder under Android folder, you can also set the Big Image icon as well. I have already written code to show bigImage icon on Notification from assets folder, currently this code is commented you can try the same by unCommenting the same in App42GCMService.java file and rebuild the plugin jar file.

Code written as :
//.setLargeIcon(getBitmapFromAssets()) at 139 line number.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...