diff --git a/CHANGELOG.md b/CHANGELOG.md index 36fa6f2d..2f801657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ To know more about breaking changes, see the [Migration Guide][]. - Improves the options when fetching fixed number of assets on iOS and macOS. +### Fixes + +- Do not use `privateFileURL` on iOS 18+. + ## 3.5.2 ### Improvements diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index d2a14bfb..793cbed9 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/ios/Classes/core/PMManager.m b/ios/Classes/core/PMManager.m index 600f5ba0..c14feaca 100644 --- a/ios/Classes/core/PMManager.m +++ b/ios/Classes/core/PMManager.m @@ -1350,6 +1350,11 @@ - (void)getMediaUrl:(NSString *)assetId if (@available(iOS 9.1, *)) { if ((asset.mediaSubtypes & PHAssetMediaSubtypePhotoLive) == PHAssetMediaSubtypePhotoLive) { + // https://github.com/fluttercandies/flutter_photo_manager/issues/1196 + if (@available(iOS 18.0, *)) { + [self fetchLivePhotosFile:asset handler:handler progressHandler:progressHandler withScheme:YES fileType:nil]; + return; + } PHAssetResource *resource = [asset getLivePhotosResource]; NSURL *url = [resource valueForKey:@"privateFileURL"]; if (url) {