Hi i am implementing Push Notifications in Android using Firebase. Now, there is a small icon showing inside one circle. I need it to show in bigger size. Please see the image. And here is my code,
android:id="@+id/relativeNotification"
android:layout_width="192dp"
android:layout_height="192dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true">
<com.inspius.coreapp.widget.TintableImageView
android:layout_width="192dp"
android:layout_height="192dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:contentDescription="@string/app_name"
android:src="@drawable/ic_launcher"
app:tint="@color/custom_icon_video_detail_selector" />
How do i set large icon from this small icon?
I think it can be done by overriding the default settings.
In your application manifest:
Use your icon instead of
@drawable/notification_icon
.Source
Hope that helps
Update: Also, Have a look:
https://github.com/firebase/quickstart-android/issues/4#issuecomment-221344318
Here is the
icon
parameter documentation:https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support
I tried to do the same thing. Overriding "handleIntent" method worked for me. I guess removing the super.handleIntent(intent) made this work. Then we can build our own notification to set the large icon. Both foreground and background cases would call this method. Something like this:
See You can customize your firebase notification only when your app is in foreground.
Your notification will be caught in onMessageReceived method of FirebaseMessagingService service
To Customize your notification when your app is in foreground.
Put Icon From App Drawable Folder
Put Icon From API "icon" tag