From e9f180ae0121e02d937b04acfeb0a92b06dc23cc Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Tue, 24 Sep 2019 10:59:01 +0100 Subject: [PATCH] see changelog (v1.4.2) * Better handling on Android of buggy file managers that return no intent when canceling the file selection even though it returns Activity.RESULT_OK (#111) * removes deprecated Android SDK code and fixes an issue that could prevent some downloaded files from being picked * adds getMultiFile and prevents UI blocking when picking large remote files * updates readme file * fixes an issue that could prevent internal storage files from being properly picked * fixes an issue that could result in a crash when picking video files on iOS 13 or above and updates go-flutter version --- CHANGELOG.md | 6 ++++++ README.md | 18 +++++++++--------- .../ios/Flutter/flutter_export_environment.sh | 11 +++++++++++ example/ios/Podfile.lock | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 5 +++-- .../xcshareddata/xcschemes/Runner.xcscheme | 8 ++------ go/go.mod | 2 +- ios/Classes/FilePickerPlugin.m | 17 ++++++++++++++++- pubspec.yaml | 2 +- 9 files changed, 50 insertions(+), 21 deletions(-) create mode 100755 example/ios/Flutter/flutter_export_environment.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 098cd3b..0613531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.4.2 + +**Bug fix** + * Fixes an issue that could cause a crash when picking video files in iOS 13 or above due to SDK changes. + * Updates Go-Flutter with go 1.13. + ## 1.4.1 **Bug fix:** Fixes an issue that could result in some cached files, picked from Google Photos (remote file), to have the name set as `null`. diff --git a/README.md b/README.md index 042f9ed..38404f3 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,15 @@ A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extensions filtering support. ## Currently supported features -* [X] Load paths from **cloud files** (GDrive, Dropbox, iCloud) -* [X] Load path from a **custom format** by providing a file extension (pdf, svg, zip, etc.) -* [X] Load path from **multiple files** optionally, supplying a file extension -* [X] Load path from **gallery** -* [X] Load path from **audio** -* [X] Load path from **video** -* [X] Load path from **any** -* [X] Create a `File` or `List` objects from **any** selected file(s) -* [X] Supports desktop through **go-flutter** (MacOS, Windows, Linux) +* Load paths from **cloud files** (GDrive, Dropbox, iCloud) +* Load path from a **custom format** by providing a file extension (pdf, svg, zip, etc.) +* Load path from **multiple files** optionally, supplying a file extension +* Load path from **gallery** +* Load path from **audio** +* Load path from **video** +* Load path from **any** +* Create a `File` or `List` objects from **any** selected file(s) +* Supports desktop through **go-flutter** (MacOS, Windows, Linux) If you have any feature that you want to see in this package, please add it [here](https://github.com/miguelpruivo/plugins_flutter_file_picker/issues/99). 🎉 diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh new file mode 100755 index 0000000..ff5b0b2 --- /dev/null +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/miguelruivo/DevTools/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/miguelruivo/Projects/Pessoais/plugins_flutter_file_picker/example" +export "FLUTTER_TARGET=/Users/miguelruivo/Projects/Pessoais/plugins_flutter_file_picker/example/lib/main.dart" +export "FLUTTER_BUILD_DIR=build" +export "SYMROOT=${SOURCE_ROOT}/../build/ios" +export "FLUTTER_FRAMEWORK_DIR=/Users/miguelruivo/DevTools/flutter/bin/cache/artifacts/engine/ios" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "TRACK_WIDGET_CREATION=true" diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index b10fa0c..6fada42 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -15,7 +15,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: file_picker: 408623be2125b79a4539cf703be3d4b3abe5e245 - Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a + Flutter: 0e3d915762c693b495b44d77113d4970485de6ec PODFILE CHECKSUM: 1e5af4103afd21ca5ead147d7b81d06f494f51a2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index a73b991..8f59f17 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -190,6 +190,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -441,7 +442,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerdemo; + PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexample; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -465,7 +466,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerdemo; + PRODUCT_BUNDLE_IDENTIFIER = com.mr.flutter.plugin.filepickerexample; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e4f93ed..486f9c3 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -27,8 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - *)urls{ NSURL *pickedVideoUrl = [info objectForKey:UIImagePickerControllerMediaURL]; NSURL *pickedImageUrl; - if (@available(iOS 11.0, *)) { + if(@available(iOS 13.0, *)){ + + if(pickedVideoUrl != nil) { + NSString * fileName = [pickedVideoUrl lastPathComponent]; + NSURL * destination = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:fileName]]; + + if([[NSFileManager defaultManager] isReadableFileAtPath: [pickedVideoUrl path]]) { + Log(@"Caching video file for iOS 13 or above..."); + [[NSFileManager defaultManager] copyItemAtURL:pickedVideoUrl toURL:destination error:nil]; + pickedVideoUrl = destination; + } + } else { + pickedImageUrl = [info objectForKey:UIImagePickerControllerImageURL]; + } + + } else if (@available(iOS 11.0, *)) { pickedImageUrl = [info objectForKey:UIImagePickerControllerImageURL]; } else { UIImage *pickedImage = [info objectForKey:UIImagePickerControllerEditedImage]; diff --git a/pubspec.yaml b/pubspec.yaml index 2c0688b..2bab731 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: file_picker description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support. author: Miguel Ruivo homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker -version: 1.4.1 +version: 1.4.2 dependencies: flutter: