Merge pull request #426 from Naveen3Singh/post_notifications

Handle post notification permission
This commit is contained in:
Tibor Kaputa 2022-09-13 11:21:51 +02:00 committed by GitHub
commit 95df1bf835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 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,12 @@ 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 {