Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ class PermissionsActivity : Activity() {
?: throw RuntimeException("Missing handler for permissionRequestType: $permissionRequestType")
if (granted) {
callback.onAccept()
_preferenceService!!.saveBool(
PreferenceStores.ONESIGNAL,
"${PreferenceOneSignalKeys.PREFS_OS_USER_RESOLVED_PERMISSION_PREFIX}$androidPermissionString",
true,
)
} else {
callback.onReject(shouldShowSettings())
}
Expand Down Expand Up @@ -132,7 +137,7 @@ class PermissionsActivity : Activity() {
) {
_preferenceService!!.saveBool(
PreferenceStores.ONESIGNAL,
"${PreferenceOneSignalKeys.PREFS_OS_USER_REJECTED_PERMISSION_PREFIX}$androidPermissionString",
"${PreferenceOneSignalKeys.PREFS_OS_USER_RESOLVED_PERMISSION_PREFIX}$androidPermissionString",
true,
)
return false
Expand All @@ -141,7 +146,7 @@ class PermissionsActivity : Activity() {

return _preferenceService!!.getBool(
PreferenceStores.ONESIGNAL,
"${PreferenceOneSignalKeys.PREFS_OS_USER_REJECTED_PERMISSION_PREFIX}$androidPermissionString",
"${PreferenceOneSignalKeys.PREFS_OS_USER_RESOLVED_PERMISSION_PREFIX}$androidPermissionString",
false,
)!!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ object PreferenceOneSignalKeys {
* (Boolean) A prefix key for the permission state. When true, the user has rejected this
* permission too many times and will not be prompted again.
*/
const val PREFS_OS_USER_REJECTED_PERMISSION_PREFIX = "USER_REJECTED_PERMISSION_"
const val PREFS_OS_USER_RESOLVED_PERMISSION_PREFIX = "USER_RESOLVED_PERMISSION_"

// HTTP
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal class NotificationPermissionController(
override val canRequestPermission: Boolean
get() = !_preferenceService.getBool(
PreferenceStores.ONESIGNAL,
"${PreferenceOneSignalKeys.PREFS_OS_USER_REJECTED_PERMISSION_PREFIX}$ANDROID_PERMISSION_STRING",
"${PreferenceOneSignalKeys.PREFS_OS_USER_RESOLVED_PERMISSION_PREFIX}$ANDROID_PERMISSION_STRING",
false,
)!!

Expand Down