Skip to content

Commit

Permalink
fix(mobile): Fix background backup on iOS (immich-app#4038)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 authored Sep 11, 2023
1 parent fd6ade2 commit 47ea47c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions mobile/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
6 changes: 5 additions & 1 deletion mobile/lib/modules/backup/services/backup.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ class BackupService {
bool anyErrors = false;
final List<String> duplicatedAssetIds = [];

// DON'T KNOW WHY BUT THIS HELPS BACKGROUND BACKUP TO WORK ON IOS
await PhotoManager.requestPermissionExtend();

for (var entity in assetList) {
try {
if (entity.type == AssetType.video) {
Expand Down Expand Up @@ -248,7 +251,8 @@ class BackupService {

req.fields['deviceAssetId'] = entity.id;
req.fields['deviceId'] = deviceId;
req.fields['fileCreatedAt'] = entity.createDateTime.toUtc().toIso8601String();
req.fields['fileCreatedAt'] =
entity.createDateTime.toUtc().toIso8601String();
req.fields['fileModifiedAt'] =
entity.modifiedDateTime.toUtc().toIso8601String();
req.fields['isFavorite'] = entity.isFavorite.toString();
Expand Down

0 comments on commit 47ea47c

Please sign in to comment.