android – Changing Push Notification Icon for Server-Side Parse Notifications in Unity-ThrowExceptions

Exception or error:

We are using UTNotifications for our local push notifications. Using Android standard, we have put in a replacement icon to appear on devices when receiving a push.

The issue is that the same function is not working for our server-side pushes from Parse. We added this line to our manifest

<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/noti_icon"/>

And added an icon to the “/drawable/”folder, but it does not retrieve it. Using Unity and Parse, what am I missing that gets this to work correctly?

How to solve:

Please correct me if I’m wrong, but as far as I understand you use UTNotifications at client side for both local and push notifications, don’t you? Because if yes, you don’t need that <meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/noti_icon"/> block in the manifest, UTNotifications manage icons in a different way. If no then, first, I recommend you to use UTNotifications for push notifications as well. Second, I can’t say much about the Parse-related issues, but possible problem is a location of the “drawable” folder: Unity since the version 5.2 ignores Assets/Plugins/Android/res folder, you have to put your drawables into one of the native plugins’ folder, f.e. UTNotifications use Assets/Plugins/Android/UTNotifications/res/drawable (but you don’t have to do it manually with UTNotifications, everything is configured using its Unity editor extension).

And, yeah, if you use UTNotifications on the client side for push notifications, setting a custom icon is being done using notification profiles. You can find more about their usage in the UTNotifications’ manual: Edit -> Project Settings -> UTNotifications -> Manual button, section “Using Notification Profiles (sounds & icons settings)“.

Leave a Reply

Your email address will not be published. Required fields are marked *