Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Do not use privateFileURL on iOS 18+ #1213

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
5 changes: 5 additions & 0 deletions ios/Classes/core/PMManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading