Request permission to send notifications

This commit is contained in:
Stypox 2022-11-28 18:49:11 +01:00
parent f07886fc5e
commit 9d01d88eed
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
2 changed files with 23 additions and 5 deletions

View file

@ -157,9 +157,12 @@ public class MainActivity extends AppCompatActivity {
}
openMiniPlayerUponPlayerStarted();
// Schedule worker for checking for new streams and creating corresponding notifications
// if this is enabled by the user.
NotificationWorker.initialize(this);
if (PermissionHelper.checkPostNotificationsPermission(this,
PermissionHelper.POST_NOTIFICATIONS_REQUEST_CODE)) {
// Schedule worker for checking for new streams and creating corresponding notifications
// if this is enabled by the user.
NotificationWorker.initialize(this);
}
}
@Override
@ -599,6 +602,9 @@ public class MainActivity extends AppCompatActivity {
((VideoDetailFragment) fragment).openDownloadDialog();
}
break;
case PermissionHelper.POST_NOTIFICATIONS_REQUEST_CODE:
NotificationWorker.initialize(this);
break;
}
}