Handle notification permission

This commit is contained in:
Naveen 2022-09-13 01:38:29 +05:30
parent bb051e3811
commit 74cc5f99b1
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@
<uses-permission android:name="android.provider.Telephony.SMS_RECEIVED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"

View File

@ -158,6 +158,9 @@ class MainActivity : SimpleActivity() {
handlePermission(PERMISSION_SEND_SMS) {
if (it) {
handlePermission(PERMISSION_READ_CONTACTS) {
handleNotificationPermission { granted ->
if (!granted) toast(R.string.no_post_notifications_permissions)
}
initMessenger()
bus = EventBus.getDefault()
try {