如何在Firebase应用通知中设置更大的图标? [英] How to set a bigger icon in Firebase app notification?

查看:267
本文介绍了如何在Firebase应用通知中设置更大的图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase在Android中实现推送通知.现在,在一个圆圈内显示了一个小图标.我需要它以更大的尺寸显示.请看图片.这是我的代码,

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:

<meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@drawable/notification_icon" />

使用图标代替@drawable/notification_icon.

来源

希望有帮助

更新:此外,看看:

https://github.com/firebase/quickstart-android/issues/4#issuecomment-221344318

icon参数可用于在您的应用程序中指定可绘制对象. 如果要使用R.drawable.foo,只需传递foo.

The icon parameter can be used to specify a drawable within your app. If you want to use R.drawable.foo, just pass foo.

这是icon参数文档:

https://firebase.google .com/docs/cloud-messaging/http-server-ref#notification-payload-support

这篇关于如何在Firebase应用通知中设置更大的图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆