[英]Firebase Notification icon is gray
雖然我在stackoverflow中做了這個解決方案,但圖標還是一樣的。
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
這里頂部圖標:
問題出在哪里? 我還使用這個網站來創建透明圖標: https://jgilfelt.github.io/AndroidAssetStudio/icons-notification.html#source.space.trim=1&source.space.pad=0&name=ic_stat_ic_launcher
我現在也是這樣的 res 文件(來自上面鏈接的可繪制文件夾):
您是否嘗試過將清單行更改為:
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_ic_launcher" />
從您的屏幕截圖看來,您只有不同分辨率的 ic_stat_ic_launcher 文件。
如果你想使用 mipmap/ic_launcher 文件,你需要將不同大小的文件添加到其他 mipmap 文件夾中(就像你擁有 mipmap/launcher_icon.png 文件一樣),否則它可能找不到哪個要使用的文件
就我而言,問題是我將
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" … />
AndroidManifest.xml 中主<activity/>
標簽下的標簽
顯然,它應該在<application/>
標簽下(在層次結構中較高)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.