feat: add cloud id during native sync

# Conflicts:
#	mobile/lib/platform/native_sync_api.g.dart
This commit is contained in:
shenlong-tanwen
2025-07-30 02:01:55 +05:30
parent ada4265cf9
commit ecbaca3cee
5 changed files with 56 additions and 0 deletions
+16
View File
@@ -286,4 +286,20 @@ class NativeSyncApiImpl: NativeSyncApi {
return FlutterStandardTypedData(bytes: Data(digest))
}
}
func getCloudIdForAssetIds(assetIds: [String]) throws -> [String : String?] {
guard #available(iOS 16, *) else {
return Dictionary(
uniqueKeysWithValues: assetIds.map { ($0, nil as String?) }
)
}
var mappings: [String: String?] = [:]
let result = PHPhotoLibrary.shared().cloudIdentifierMappings(forLocalIdentifiers: assetIds)
for (key, value) in result {
let id = try? value.get().stringValue
mappings[key] = id
}
return mappings;
}
}