I want to Change the default Firebase Icon that is displayed when sending Push Notification (Firebase Cloud Messaging), but I'm not able to do so in Unity, I tried Many methods available on Google and StackOverFlow, But None of Them Worked. Please Help me with Your Solutions...
I tried adding res
folder to Assets\Plugins\Android
but it shows OBSOLETE - Providing Android resources in Assets/Plugins/Android/res was removed
, I also tried using .aar
method but it shows
> Could not resolve all files for configuration ':unityLibrary:releaseCompileClasspath'.
> Failed to transform ic_stat_sb-.aar (:ic_stat_sb:) to match attributes {artifactType=android-classes-jar, org.gradle.status=integration, org.gradle.usage=java-api}.
The solution to this is to build an AAR library that contains your icons. Here's how you can do it with Android Studio.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_card_giftcard" />
</application>
</manifest>
ic_stat_card_giftcard
to what your icon name is.Gradle should start the build and once done you can find your .aar file in the same directory as your application under MyApplication<YourLibraryName>\build\outputs\aar
Take that aar file and copy it into Unity assets/Plugins/Android and build your game.
You should be able to see the icon once you receive a notification from firebase!