【问题标题】:FCM - When setting icon in meta data, should I use the mipmap folder?FCM - 在元数据中设置图标时,我应该使用 mipmap 文件夹吗?
【发布时间】:2017-01-18 19:00:31
【问题描述】:

要使用 FCM 设置默认图标,我们可以在 Android 清单中添加一个元标记。我的当前如下所示,因为我想在接收推送通知时使用我的应用程序的图标作为通知图标:

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

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorAccent" />

请注意,我正在从 mipmap 文件夹中获取 ic_logo_launcher.png。这是可取的吗?

【问题讨论】:

标签: android firebase android-notifications firebase-cloud-messaging android-mipmap


【解决方案1】:

是的!你可以……虽然 firebase 默认采用 app_icon

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@mipmap/ic_launcher" />
<meta-data
    android:name="com.google.firebase.messaging.default_notification_color"
    android:resource="@color/notificationBackground" />

但最好使用来自@drawable 的图标,该图标将具有alpha 和白色图标。

【讨论】:

  • Suggestion: add 'tools:replace="android:resource"'
  • 嗨,我是 android native 的新手,在 ionic 中使用 FCM 在 manifest.xml 中放置元标记的位置?
  • Ionic 是混合模式。我不知道该放在哪里。
猜你喜欢
  • 2015-05-08
  • 1970-01-01
  • 2016-12-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多