更改Firebase通知标题颜色-Android 9.0

更改Firebase通知标题颜色-Android 9.0,android,firebase,firebase-cloud-messaging,Android,Firebase,Firebase Cloud Messaging,我正在尝试确保当我的应用程序收到Firebase通知时,会显示默认的Firebase通知图标和颜色。这是这样做的: 在onMessageReceived函数中: NotificationCompat.Builder notificationcompatingbuilder= 新通知兼容性生成器( mContext.getApplicationContext(), mContext.getString(R.string.notificationChannelID) ) .setSmallIcon(

我正在尝试确保当我的应用程序收到Firebase通知时,会显示默认的Firebase通知图标和颜色。这是这样做的:

  • onMessageReceived
    函数中:
  • NotificationCompat.Builder notificationcompatingbuilder=
    新通知兼容性生成器(
    mContext.getApplicationContext(),
    mContext.getString(R.string.notificationChannelID)
    )
    .setSmallIcon(R.drawable.eb_标志)
    setLargeIcon先生(
    BitmapFactory.decodeResource(mContext.getResources(),R.mipmap.ic_launcher_round)
    )
    .setColor(Color.parseColor(“#4dbeed”))
    .setContentTitle(标题)
    .setContentText(内容)
    .setAutoCancel(真)
    .setChannelId(channelID)
    .setPriority(通道重要性);
    
  • 在manifest
    AndroidManifest.xml
    文件中,如下所示:
  • 
    
    这在安卓8.0上非常有效。然而,在Android 9.0及更高版本上,尽管有上述更改,标题文本的颜色仍然是默认的灰色

    我发现了一个链接:这似乎暗示了这一点

    还有其他人面临同样的问题吗?我查看了相关的firebase云消息和android 9.0变更日志,没有发现任何内容


    这方面的任何帮助都是非常好的。

    我可以知道,
    android:resource=“@drawable/eb_logo”
    大小需要变小吗?@Ticherhaz:恐怕我不明白这个问题。你是说eb_徽标是否需要小尺寸?是的,它是否需要小尺寸?