- https://developer.android.com/develop/u ... ive-update />
- https://www.youtube.com/watch?v=IHR8HL_HMEC
- Пример Github
[*] Чип статуса: я не могу показать, что в моем текущем устройстве Android 16 Pixel 7. Или эмуляторы Android 16. < /Li>
Код: Выделить всё
NotificationManager.canPostPromotedNotifications()
sutures.action_manage_app_promoted_notifications: Официальная документация говорит о использовании настройки. Но на самом деле этого не существует. Что существует, так это настройки. val notificationManager = getSystemService(NOTIFICATION_SERVICE) as android.app.NotificationManager
notificationManager
val canPostLiveUpdates = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
notificationManager.canPostPromotedNotifications()
} else {
false
}
if(!canPostLiveUpdates) {
val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
val intent = Intent(ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS)
intent.putExtra(EXTRA_APP_PACKAGE, applicationContext.packageName)
} else {
null
}
intent?.let {
startActivityForResult(it, 10310)
}
}
< /code>
Это сбоя приложения, бросая android.content.activitynotfoundexception < /code>
Вот скриншоты о результате тестов на обновления в прямом эфире, ссылающиеся на проблемы:
Подробнее здесь: https://stackoverflow.com/questions/796 ... always-fal