OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
617 stars 213 forks source link

how to custom onesignal push notification icons ?? #371

Closed wangxingxing123654 closed 3 years ago

wangxingxing123654 commented 3 years ago

https://documentation.onesignal.com/docs/customize-notification-icons#how-to-add-default-icons

there are no flutte versions, so i try to make ic_stat_onesignal_default icons, and put them into android/app/src/main/res/drawable-mdpi/ (24x24) android/app/src/main/res/drawable-hdpi/ (36x36) android/app/src/main/res/drawable-xhdpi/ (48x48) android/app/src/main/res/drawable-xxhdpi/ (72x72) android/app/src/main/res/drawable-xxxhdpi/ (96x96) android/app/src/main/res/drawable-xxxhdpi/ (256x256) (Large Icon)

but it didnot worked ,just as white ring bell.

meek2100 commented 3 years ago

Here is how I'm accomplishing it. I'm pretty sure this matches the linked guide you mention, but I can confirm it is working for me with the following:

Add this code to android/app/src/main/AndroidManifest.xml.

    <meta-data
        android:name="com.onesignal.messaging.default_notification_icon"
        android:resource="@drawable/ic_stat_onesignal_default" />

    <meta-data
        android:name="com.onesignal.NotificationAccentColor.DEFAULT"
        android:value="FFFFFF" />

Then add "ic_stat_onesignal_default.png" files to:

android/app/src/main/res/drawable-mdpi/ android/app/src/main/res/drawable-hdpi/ android/app/src/main/res/drawable-xhdpi/ android/app/src/main/res/drawable-xxhdpi/ android/app/src/main/res/drawable-xxxhdpi/ android/app/src/main/res/drawable-xxxhdpi/

Jeasmine commented 3 years ago

Hey @wangxingxing123654, was this solved?

Jeffy503 commented 3 years ago

working ! Thanks. @meek2100