Open Hajrakhan opened 3 months ago
Does this error occur even with permissions granted?
I ran flutter clean
and restarted the simulator, which solved the MissingPluginException error. Hope this helps!
Does this error occur even with permissions granted?
yes this issue still occurs if permission is granted
It does not appear that iOS allows saving photos in the background. There is nothing I can work on at this time, but I may be able to work on it when more information comes to light.
Did you check the documentation and it did not help?
Overview
When using the gal plugin to save images to the device's gallery within a background task scheduled by Flutter Work Manager on iOS, the operation fails with a MissingPluginException for the requestAccess method of the gal plugin.
Error saving image 3: MissingPluginException(No implementation found for method requestAccess on channel gal)
Steps to reproduce
Code sample
Future downloadImagesIOS(bookingId, token) async {
PhotovaultBackend photovaultBackend = PhotovaultBackend();
//download list of images
dropboxFile = await photovaultBackend.getPictures(bookingId, token: token);
var dio = Dio();
for (int i = 0; i < dropboxFile.length; i++) {
try {
var response = await dio.get(dropboxFile[i].file!,
options: Options(responseType: ResponseType.bytes));
try {
Uint8List imageData = Uint8List.fromList(response.data);
await Gal.putImageBytes(imageData);
} catch (e) {
print('Error saving image $i: $e');
}
} catch (e, stackTrace) {
print("Error saving image: $e");
}
}
}
Environment
Flutter (Channel stable, 3.19.4, on macOS 13.6 22G120 darwin-x64, locale en-PK) • Flutter version 3.19.4 on channel stable at /Users/apple/Documents/FlutterDev/sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 68bfaea224 (3 months ago), 2024-03-20 15:36:31 -0700 • Engine revision a5c24f538d • Dart version 3.3.2 • DevTools version 2.31.1
[✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.15.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.90.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0
[✓] VS Code (version 1.82.2) • VS Code at /Users/apple/Downloads/Visual Studio Code.app/Contents • Flutter extension version 3.90.0
[✓] Connected device (3 available) • iPhone SE (3rd generation) (mobile) • 2785EBB4-ABF1-433D-B0EB-83AF0041B631 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
[✓] Network resources • All expected network resources are available.
Logs
Logs
```console [Paste your logs here] ```