Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-20 12:30:53 +05:00
parent 76c5fd4032
commit 9b665a76b3
9 changed files with 33 additions and 23 deletions

View file

@ -2,9 +2,19 @@ package com.tangem.features.pushnotifications.api.utils
import android.Manifest
import android.os.Build
import androidx.annotation.ChecksSdkIntAtLeast
val PUSH_PERMISSION = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.TIRAMISU)
private val isRequirePushPermission = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
val PUSH_PERMISSION = if (isRequirePushPermission) {
Manifest.permission.POST_NOTIFICATIONS
} else {
"android.permission.POST_NOTIFICATIONS"
}
fun getPushPermissionOrNull() = if (isRequirePushPermission) {
Manifest.permission.POST_NOTIFICATIONS
} else {
null
}

View file

@ -11,6 +11,7 @@ import com.tangem.core.ui.components.showcase.model.ShowcaseItemModel
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.utils.requestPushPermission
import com.tangem.feature.pushnotifications.impl.R
import com.tangem.features.pushnotifications.api.utils.getPushPermissionOrNull
import kotlinx.collections.immutable.persistentListOf
@Composable
@ -27,6 +28,7 @@ internal fun PushNotificationsScreen(
onAllow = onAllow,
onDeny = onLater,
onOpenSettings = onOpenSettings,
pushPermission = getPushPermissionOrNull(),
)
Showcase(