Android推送通知声音在某些设备(LG)中响起不止一次
我正在从服务器向设备发送推送通知,但在某些设备中,即使消息只发送了一次,通知声音也会响不止一次 在三星、小米和华硕,它工作正常,但在LG棉花糖,声音响不止一次 这是我的代码:Android推送通知声音在某些设备(LG)中响起不止一次,android,firebase,push-notification,firebase-cloud-messaging,Android,Firebase,Push Notification,Firebase Cloud Messaging,我正在从服务器向设备发送推送通知,但在某些设备中,即使消息只发送了一次,通知声音也会响不止一次 在三星、小米和华硕,它工作正常,但在LG棉花糖,声音响不止一次 这是我的代码: NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); inboxStyle.addLine(message); Notification notification; no
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
inboxStyle.addLine(message);
Notification notification;
notification = mBuilder
.setPriority(Notification.PRIORITY_MAX)
.setSmallIcon(R.drawable.iconnotif)
.setTicker(message)
.setAutoCancel(true)
.setContentTitle(title)
.setContentIntent(resultPendingIntent)
.setSound(Settings.System.DEFAULT_NOTIFICATION_URI)
.setStyle(inboxStyle)
.setSmallIcon(R.drawable.iconnotif)
.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), icon))
.setContentText(message)
.build();
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "TAG");
wl.acquire(15000);
NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notification);
请帮忙。谢谢。你好。这会发生在所有使用棉花糖的LG设备上吗?或者仅适用于特定的设备型号?您好。这会发生在所有使用棉花糖的LG设备上吗?还是仅适用于特定的设备型号?