Android 通知振动限制

时间:2020-12-22 03:14:51

标签: android notifications

我正在使用安卓通知, 我想知道当我每隔一秒发送通知时,只有第一个通知会振动。这是系统默认的吗? 有没有办法让每个通知都振动?

            Notification newMessageNotification1 = new NotificationCompat.Builder(this, id)
                .setSmallIcon(R.drawable.notification)
                .setContentTitle(title)
                .setContentText(body)
                .setColor(getColor(R.color.md_red_700))
                .setGroup(GROUP_KEY_WORK_EMAIL)
                .build();
        Notification summaryNotification = new NotificationCompat.Builder(this, id)
                .setSmallIcon(R.drawable.notification)
                .setColor(getColor(R.color.md_red_700))
                .setSmallIcon(R.drawable.notification)
                .setPriority(NotificationCompat.PRIORITY_HIGH)
                .setContentTitle("eForm")
                .setContentText("")
                .setGroup(GROUP_KEY_WORK_EMAIL)
                .setGroupSummary(true)
                .setChannelId(id)
                .setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE)
                .setCategory(Notification.CATEGORY_SOCIAL)
                .build();

        mNotificationManager.notify((int) System.currentTimeMillis(), newMessageNotification1);
        mNotificationManager.notify(notificationId, summaryNotification);

0 个答案:

没有答案