forked from upstream-mirrors/quik
Request notification permission on Android 13
This commit is contained in:
@@ -281,6 +281,14 @@ class Navigator @Inject constructor(
|
||||
startActivityExternal(intent)
|
||||
}
|
||||
|
||||
fun showPermissions() {
|
||||
val intent = Intent()
|
||||
intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
||||
intent.data = Uri.fromParts("package", context.packageName, null)
|
||||
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
fun showNotificationSettings(threadId: Long = 0) {
|
||||
val intent = Intent(context, NotificationPrefsActivity::class.java)
|
||||
intent.putExtra("threadId", threadId)
|
||||
|
||||
@@ -57,6 +57,7 @@ import com.moez.QKSMS.util.GlideApp
|
||||
import com.moez.QKSMS.util.PhoneNumberUtils
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
import com.moez.QKSMS.util.tryOrNull
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -94,6 +95,11 @@ class NotificationManagerImpl @Inject constructor(
|
||||
return
|
||||
}
|
||||
|
||||
if (!permissions.hasNotifications()) {
|
||||
Timber.w("Cannot update notification because we don't have the notification permission")
|
||||
return
|
||||
}
|
||||
|
||||
val messages = messageRepo.getUnreadUnseenMessages(threadId)
|
||||
|
||||
// If there are no messages to be displayed, make sure that the notification is dismissed
|
||||
|
||||
Reference in New Issue
Block a user