你好,我已经在我的应用程序中实现了推送通知。它工作正常,并正确地显示通知图标以下的设备的牛油果版本。
但是,它将通知图标显示为白色正方形。
下面是我的代码:
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.app_icon)
.setColor(ContextCompat.getColor(getApplicationContext(),R.color.white))
.setContentTitle(strTitle)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(++NOTIFICATION_ID /* ID of notification */, notificationBuilder.build());
https://stackoverflow.com/questions/46150324
复制相似问题