Код: Выделить всё
AlarmFullScreenModule[*]
Код: Выделить всё
MainActivity.kt[*]
Код: Выделить всё
AlarmNotificationHelper.ktКод: Выделить всё
- mainActivity:
armiddisplayactivity: < /strong> < /li>
< /ol>
Код: Выделить всё
Код: Выделить всё
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD)
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED)
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
Код: Выделить всё
NotificationChannel(
"alarm-notifications",
"Alarm Notifications",
NotificationManager.IMPORTANCE_HIGH
).apply {
enableLights(true)
lightColor = Color.RED
enableVibration(true)
vibrationPattern = longArrayOf(100, 500, 100, 500)
setBypassDnd(true)
lockscreenVisibility = Notification.VISIBILITY_PUBLIC
setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM), null)
audioAttributes = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build()
notificationManager.createNotificationChannel(this)
}
NotificationCompat.Builder(context, "alarm-notifications")
.setPriority(NotificationCompat.PRIORITY_MAX)
.setCategory(NotificationCompat.CATEGORY_ALARM)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setFullScreenIntent(fullScreenPendingIntent, true)
.setOngoing(true)
.setAutoCancel(true)
// ... other configurations like sound, vibration, etc.
.build()
< /code>
Несмотря на эти усилия, результат остается таким же: небольшой пузырь уведомлений появляется на экране блокировки вместо полноэкранного управления с контролем тревоги. Любые предложения по шагам устранения неполадок или альтернативных подходов были бы очень оценены.
Подробнее здесь: https://stackoverflow.com/questions/796 ... act-native
Мобильная версия