0

AndroidアプリでFCMプッシュ通知を実装したばかりで、アプリが開いているときにのみシルエットアイコンが読み込まれているように見えますが、または私は白い円を代わりに最小化した。私はそれが私のic_stat_whiteアイコンの代わりにic_launcherアイコンを表示していると思う。私はPhotoshopでベースアイコンを作成し、Android Asset Studioを使用してすべてのサイズ(https://romannurik.github.io/AndroidAssetStudio/icons-notification.html)を取得しました。プッシュ通知メッセージ(「アイコン」:ic_stat_white ")、キャッシュを無効にしたり、Stack Overflowで見つけられるものは何もありません。私Firebaseメッセージングサービスクラスでアプリが閉鎖または最小化されているときにAndroidのホワイト通知

私は、通知を作成するには、次のコードを持っている:私はへのアクセスを得ることができないアプリのように感じる

private int getNotificationIcon() { 
    boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.LOLLIPOP);   
    return useWhiteIcon ? R.drawable.ic_stat_white : R.mipmap.ic_launcher; 
} 

NotificationCompat.Builder mBuilder = 
       (NotificationCompat.Builder) new NotificationCompat.Builder(this) 
         .setSmallIcon(getNotificationIcon()) 
         .setContentTitle("App name") 
         .setAutoCancel(true) 
         .setContentText(message); 

mBuilder.setContentIntent(resultPendingIntent); 
// Sets an ID for the notification 
int mNotificationId = 001; 
// Gets an instance of the NotificationManager service 
NotificationManager mNotifyMgr = 
       (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 
// Builds the notification and issues it. 
mNotifyMgr.notify(mNotificationId, mBuilder.build()); 

とgetNotificationIcon方法をアプリの外からのアイコンなど、私は追加しましたが、

import com.appname.R; 

全く使われていないようです。

誰でも問題がここにある可能性がありますか?

乾杯!

+0

ここに同じ質問に対する私の答えをご覧ください。 ます。https: https://stackoverflow.com/questions/37616065/android-notification-icon-issue/44879510#44879510 –

答えて

0

FCM管理パネルからアイコンを設定しても問題が発生しましたが、PHPで自分自身のバックエンドコントローラを作成した後に、プッシュ通知を呼び出さなくてもアプリでこの動作が得られないようです自分のシステムでは、まだ空白のアイコン(???)が表示されます。

​​

乾杯!

+0

ここに同じ質問に対する私の答えを参照してください。 //stackoverflow.com/questions/37616065/android-notification-icon-issue/44879510#44879510 –

関連する問題