diff --git a/mobile/lib/services/local_sync_service.dart b/mobile/lib/services/local_sync_service.dart index b480661cb..858a98c6e 100644 --- a/mobile/lib/services/local_sync_service.dart +++ b/mobile/lib/services/local_sync_service.dart @@ -61,7 +61,14 @@ class LocalSyncService { return; } if (Platform.isAndroid && AppLifecycleService.instance.isForeground) { - final permissionState = await PhotoManager.requestPermissionExtend(); + final permissionState = await PhotoManager.requestPermissionExtend( + requestOption: const PermissionRequestOption( + androidPermission: AndroidPermission( + type: RequestType.common, + mediaLocation: true, + ), + ), + ); if (permissionState != PermissionState.authorized) { _logger.severe( "sync requested with invalid permission", diff --git a/mobile/lib/ui/components/home_header_widget.dart b/mobile/lib/ui/components/home_header_widget.dart index 6fb8f0f6d..567c138f0 100644 --- a/mobile/lib/ui/components/home_header_widget.dart +++ b/mobile/lib/ui/components/home_header_widget.dart @@ -48,7 +48,14 @@ class _HomeHeaderWidgetState extends State { onTap: () async { try { final PermissionState state = - await PhotoManager.requestPermissionExtend(); + await PhotoManager.requestPermissionExtend( + requestOption: const PermissionRequestOption( + androidPermission: AndroidPermission( + type: RequestType.common, + mediaLocation: true, + ), + ), + ); await LocalSyncService.instance.onUpdatePermission(state); } on Exception catch (e) { Logger("HomeHeaderWidget").severe( diff --git a/mobile/lib/ui/home/grant_permissions_widget.dart b/mobile/lib/ui/home/grant_permissions_widget.dart index 29c8e5e1b..13a4ad466 100644 --- a/mobile/lib/ui/home/grant_permissions_widget.dart +++ b/mobile/lib/ui/home/grant_permissions_widget.dart @@ -91,7 +91,14 @@ class GrantPermissionsWidget extends StatelessWidget { key: const ValueKey("grantPermissionButton"), child: Text(S.of(context).grantPermission), onPressed: () async { - final state = await PhotoManager.requestPermissionExtend(); + final state = await PhotoManager.requestPermissionExtend( + requestOption: const PermissionRequestOption( + androidPermission: AndroidPermission( + type: RequestType.common, + mediaLocation: true, + ), + ), + ); if (state == PermissionState.authorized || state == PermissionState.limited) { await SyncService.instance.onPermissionGranted(state); diff --git a/mobile/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart b/mobile/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart index 0f2510d74..2db611d47 100644 --- a/mobile/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart +++ b/mobile/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart @@ -203,7 +203,14 @@ class AddPhotosPhotoWidget extends StatelessWidget { } } catch (e) { if (e is StateError) { - final PermissionState ps = await PhotoManager.requestPermissionExtend(); + final PermissionState ps = await PhotoManager.requestPermissionExtend( + requestOption: const PermissionRequestOption( + androidPermission: AndroidPermission( + type: RequestType.common, + mediaLocation: true, + ), + ), + ); if (ps != PermissionState.authorized && ps != PermissionState.limited) { await showChoiceDialog( context,