mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 08:30:29 +00:00
Merge PR #1497 latest head: fix(android) restore notification permission prompt
This commit is contained in:
commit
9558042513
1 file changed
+7
@@ -28,6 +28,13 @@ class AndroidForegroundService {
|
||||
),
|
||||
);
|
||||
|
||||
// Android 13+ requires runtime permission to show the service notification.
|
||||
// A denial only hides it from the notification drawer; the service can run.
|
||||
final permission = await FlutterForegroundTask.checkNotificationPermission();
|
||||
if (permission == NotificationPermission.denied) {
|
||||
await FlutterForegroundTask.requestNotificationPermission();
|
||||
}
|
||||
|
||||
if (await FlutterForegroundTask.isRunningService) {
|
||||
_throwOnFailure(await FlutterForegroundTask.restartService());
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user