Skip to content

Commit bc2d378

Browse files
committed
Fix Permission error
1 parent 8b1d212 commit bc2d378

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<uses-permission android:name="io.github.normalllll.yande_gui.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" tools:node="remove" />
77
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
88
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
9+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
910

1011

1112
<application

lib/downloader/platform/downloader_android.dart

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:developer';
33
import 'package:device_info_plus/device_info_plus.dart';
44
import 'package:flutter/services.dart';
55
import 'package:flutter_easyloading/flutter_easyloading.dart';
6-
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
76
import 'package:path_provider/path_provider.dart';
87
import 'package:permission_handler/permission_handler.dart';
98
import 'package:yande_gui/download_foreground_service_plugin.dart';
@@ -87,22 +86,6 @@ class DownloaderAndroid<T> extends DownloaderPlatform<T> {
8786
SettingsService.maxConcurrentDownloadsStream.listen((_) {
8887
_downloadQueueManager.schedule();
8988
});
90-
FlutterForegroundTask.init(
91-
androidNotificationOptions: AndroidNotificationOptions(
92-
channelId: 'foreground_service',
93-
channelName: 'Foreground Service Notification',
94-
channelDescription: 'This notification appears when the foreground service is running.',
95-
onlyAlertOnce: true,
96-
),
97-
iosNotificationOptions: const IOSNotificationOptions(showNotification: false, playSound: false),
98-
foregroundTaskOptions: ForegroundTaskOptions(
99-
eventAction: ForegroundTaskEventAction.repeat(5000),
100-
autoRunOnBoot: true,
101-
autoRunOnMyPackageReplaced: true,
102-
allowWakeLock: true,
103-
allowWifiLock: true,
104-
),
105-
);
10689
}
10790

10891
@override
@@ -157,10 +140,6 @@ class DownloaderAndroid<T> extends DownloaderPlatform<T> {
157140
task.emit(task.state.copyWith(status: DownloadStatus.busying));
158141
break;
159142
case DownloadEventProgress(:final value):
160-
FlutterForegroundTask.updateService(
161-
notificationTitle: 'Yande GUI Downloader',
162-
notificationText: '${task.fileName} ${(value * 100).toStringAsFixed(2)}%',
163-
);
164143
task.emit(task.state.copyWith(status: DownloadStatus.busying, progress: value));
165144
break;
166145
case DownloadEventSuccess():

0 commit comments

Comments
 (0)