Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/210.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android推送通知声音在某些设备(LG)中响起不止一次_Android_Firebase_Push Notification_Firebase Cloud Messaging - Fatal编程技术网

Android推送通知声音在某些设备(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

我正在从服务器向设备发送推送通知,但在某些设备中,即使消息只发送了一次,通知声音也会响不止一次

在三星、小米和华硕,它工作正常,但在LG棉花糖,声音响不止一次

这是我的代码:

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设备上吗?还是仅适用于特定的设备型号?