Skip to content

Commit ed1f780

Browse files
authored
[image_picker] Update minimum Flutter version to 3.3 and iOS 11 (#3327)
[image_picker] Update minimum Flutter version to 3.3 and iOS 11
1 parent 4397336 commit ed1f780

File tree

17 files changed

+50
-47
lines changed

17 files changed

+50
-47
lines changed

packages/image_picker/image_picker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.6+4
2+
3+
* Updates iOS minimum version in README.
4+
15
## 0.8.6+3
26

37
* Updates links for the merge of flutter/plugins into flutter/packages.

packages/image_picker/image_picker/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55
A Flutter plugin for iOS and Android for picking images from the image library,
66
and taking new pictures with the camera.
77

8-
| | Android | iOS | Web |
9-
|-------------|---------|--------|----------------------------------|
10-
| **Support** | SDK 21+ | iOS 9+ | [See `image_picker_for_web `][1] |
8+
| | Android | iOS | Web |
9+
|-------------|---------|---------|---------------------------------|
10+
| **Support** | SDK 21+ | iOS 11+ | [See `image_picker_for_web`][1] |
1111

1212
## Installation
1313

1414
First, add `image_picker` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/platform-integration/platform-channels).
1515

1616
### iOS
1717

18-
This plugin requires iOS 9.0 or higher.
19-
2018
Starting with version **0.8.1** the iOS implementation uses PHPicker to pick (multiple) images on iOS 14 or higher.
2119
As a result of implementing PHPicker it becomes impossible to pick HEIC images on the iOS simulator in iOS 14+. This is a known issue. Please test this on a real device, or test with non-HEIC images until Apple solves this issue. [63426347 - Apple known issue](https://www.google.com/search?q=63426347+apple&sxsrf=ALeKk01YnTMid5S0PYvhL8GbgXJ40ZS[…]t=gws-wiz&ved=0ahUKEwjKh8XH_5HwAhWL_rsIHUmHDN8Q4dUDCA8&uact=5)
2220

packages/image_picker/image_picker/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
<string>arm64</string>
2626
</array>
2727
<key>MinimumOSVersion</key>
28-
<string>9.0</string>
28+
<string>11.0</string>
2929
</dict>
3030
</plist>

packages/image_picker/image_picker/example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

packages/image_picker/image_picker/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -234,10 +234,12 @@
234234
/* Begin PBXShellScriptBuildPhase section */
235235
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
236236
isa = PBXShellScriptBuildPhase;
237+
alwaysOutOfDate = 1;
237238
buildActionMask = 2147483647;
238239
files = (
239240
);
240241
inputPaths = (
242+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
241243
);
242244
name = "Thin Binary";
243245
outputPaths = (
@@ -248,6 +250,7 @@
248250
};
249251
9740EEB61CF901F6004384FC /* Run Script */ = {
250252
isa = PBXShellScriptBuildPhase;
253+
alwaysOutOfDate = 1;
251254
buildActionMask = 2147483647;
252255
files = (
253256
);
@@ -361,7 +364,7 @@
361364
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
362365
GCC_WARN_UNUSED_FUNCTION = YES;
363366
GCC_WARN_UNUSED_VARIABLE = YES;
364-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
367+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
365368
MTL_ENABLE_DEBUG_INFO = YES;
366369
ONLY_ACTIVE_ARCH = YES;
367370
SDKROOT = iphoneos;
@@ -411,7 +414,7 @@
411414
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
412415
GCC_WARN_UNUSED_FUNCTION = YES;
413416
GCC_WARN_UNUSED_VARIABLE = YES;
414-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
417+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
415418
MTL_ENABLE_DEBUG_INFO = NO;
416419
SDKROOT = iphoneos;
417420
TARGETED_DEVICE_FAMILY = "1,2";

packages/image_picker/image_picker/example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,9 @@
5555
</array>
5656
<key>UIViewControllerBasedStatusBarAppearance</key>
5757
<false/>
58+
<key>CADisableMinimumFrameDurationOnPhone</key>
59+
<true/>
60+
<key>UIApplicationSupportsIndirectInputEvents</key>
61+
<true/>
5862
</dict>
5963
</plist>

packages/image_picker/image_picker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image
33
library, and taking new pictures with the camera.
44
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
6-
version: 0.8.6+3
6+
version: 0.8.6+4
77

88
environment:
99
sdk: ">=2.14.0 <3.0.0"

packages/image_picker/image_picker_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.7
2+
3+
* Updates minimum Flutter version to 3.3 and iOS 11.
4+
15
## 0.8.6+9
26

37
* Updates links for the merge of flutter/plugins into flutter/packages.

packages/image_picker/image_picker_ios/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
<string>arm64</string>
2626
</array>
2727
<key>MinimumOSVersion</key>
28-
<string>9.0</string>
28+
<string>11.0</string>
2929
</dict>
3030
</plist>

packages/image_picker/image_picker_ios/example/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -31,7 +31,7 @@ target 'Runner' do
3131
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3232

3333
target 'RunnerTests' do
34-
platform :ios, '9.0'
34+
platform :ios, '11.0'
3535
inherit! :search_paths
3636
# Pods for testing
3737
pod 'OCMock', '~> 3.8.1'

packages/image_picker/image_picker_ios/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -442,10 +442,12 @@
442442
/* Begin PBXShellScriptBuildPhase section */
443443
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
444444
isa = PBXShellScriptBuildPhase;
445+
alwaysOutOfDate = 1;
445446
buildActionMask = 2147483647;
446447
files = (
447448
);
448449
inputPaths = (
450+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
449451
);
450452
name = "Thin Binary";
451453
outputPaths = (
@@ -456,6 +458,7 @@
456458
};
457459
9740EEB61CF901F6004384FC /* Run Script */ = {
458460
isa = PBXShellScriptBuildPhase;
461+
alwaysOutOfDate = 1;
459462
buildActionMask = 2147483647;
460463
files = (
461464
);
@@ -618,7 +621,7 @@
618621
CODE_SIGN_STYLE = Automatic;
619622
GCC_C_LANGUAGE_STANDARD = gnu11;
620623
INFOPLIST_FILE = RunnerUITests/Info.plist;
621-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
624+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
622625
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
623626
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
624627
MTL_FAST_MATH = YES;
@@ -641,7 +644,7 @@
641644
CODE_SIGN_STYLE = Automatic;
642645
GCC_C_LANGUAGE_STANDARD = gnu11;
643646
INFOPLIST_FILE = RunnerUITests/Info.plist;
644-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
647+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
645648
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
646649
MTL_FAST_MATH = YES;
647650
PRODUCT_BUNDLE_IDENTIFIER = com.google.RunnerUITests;
@@ -699,7 +702,7 @@
699702
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
700703
GCC_WARN_UNUSED_FUNCTION = YES;
701704
GCC_WARN_UNUSED_VARIABLE = YES;
702-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
705+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
703706
MTL_ENABLE_DEBUG_INFO = YES;
704707
ONLY_ACTIVE_ARCH = YES;
705708
SDKROOT = iphoneos;
@@ -749,7 +752,7 @@
749752
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
750753
GCC_WARN_UNUSED_FUNCTION = YES;
751754
GCC_WARN_UNUSED_VARIABLE = YES;
752-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
755+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
753756
MTL_ENABLE_DEBUG_INFO = NO;
754757
SDKROOT = iphoneos;
755758
TARGETED_DEVICE_FAMILY = "1,2";

packages/image_picker/image_picker_ios/example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,9 @@
5555
</array>
5656
<key>UIViewControllerBasedStatusBarAppearance</key>
5757
<false/>
58+
<key>CADisableMinimumFrameDurationOnPhone</key>
59+
<true/>
60+
<key>UIApplicationSupportsIndirectInputEvents</key>
61+
<true/>
5862
</dict>
5963
</plist>

packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerPluginTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ - (void)testPickMultiImageShouldUseUIImagePickerControllerOnPreiOS14 {
182182
[mockUIImagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]);
183183
}
184184

185-
- (void)testPickImageWithoutFullMetadata API_AVAILABLE(ios(11)) {
185+
- (void)testPickImageWithoutFullMetadata {
186186
id mockUIImagePicker = OCMClassMock([UIImagePickerController class]);
187187
id photoLibrary = OCMClassMock([PHPhotoLibrary class]);
188188

@@ -200,7 +200,7 @@ - (void)testPickImageWithoutFullMetadata API_AVAILABLE(ios(11)) {
200200
OCMVerify(times(0), [photoLibrary authorizationStatus]);
201201
}
202202

203-
- (void)testPickMultiImageWithoutFullMetadata API_AVAILABLE(ios(11)) {
203+
- (void)testPickMultiImageWithoutFullMetadata {
204204
id mockUIImagePicker = OCMClassMock([UIImagePickerController class]);
205205
id photoLibrary = OCMClassMock([PHPhotoLibrary class]);
206206

packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerPhotoAssetUtil.m

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,7 @@
1111
@implementation FLTImagePickerPhotoAssetUtil
1212

1313
+ (PHAsset *)getAssetFromImagePickerInfo:(NSDictionary *)info {
14-
if (@available(iOS 11, *)) {
15-
return [info objectForKey:UIImagePickerControllerPHAsset];
16-
}
17-
#pragma clang diagnostic push
18-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
19-
NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL];
20-
if (!referenceURL) {
21-
return nil;
22-
}
23-
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithALAssetURLs:@[ referenceURL ]
24-
options:nil];
25-
return result.firstObject;
26-
#pragma clang diagnostic pop
14+
return info[UIImagePickerControllerPHAsset];
2715
}
2816

2917
+ (PHAsset *)getAssetFromPHPickerResult:(PHPickerResult *)result API_AVAILABLE(ios(14)) {

packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerPlugin.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,10 @@ - (void)launchUIImagePickerWithSource:(nonnull FLTSourceSpecification *)source
137137
camera:[self cameraDeviceForSource:source]];
138138
break;
139139
case FLTSourceTypeGallery:
140-
if (@available(iOS 11, *)) {
141-
if (context.requestFullMetadata) {
142-
[self checkPhotoAuthorizationWithImagePicker:imagePickerController];
143-
} else {
144-
[self showPhotoLibraryWithImagePicker:imagePickerController];
145-
}
146-
} else {
147-
// Prior to iOS 11, accessing gallery requires authorization
140+
if (context.requestFullMetadata) {
148141
[self checkPhotoAuthorizationWithImagePicker:imagePickerController];
142+
} else {
143+
[self showPhotoLibraryWithImagePicker:imagePickerController];
149144
}
150145
break;
151146
default:

packages/image_picker/image_picker_ios/ios/image_picker_ios.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Downloaded by pub (not CocoaPods).
1818
s.public_header_files = 'Classes/**/*.h'
1919
s.module_map = 'Classes/ImagePickerPlugin.modulemap'
2020
s.dependency 'Flutter'
21-
s.platform = :ios, '9.0'
22-
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
21+
s.platform = :ios, '11.0'
22+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2323
end

packages/image_picker/image_picker_ios/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: image_picker_ios
22
description: iOS implementation of the image_picker plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
5-
version: 0.8.6+9
5+
version: 0.8.7
66

77
environment:
8-
sdk: ">=2.14.0 <3.0.0"
9-
flutter: ">=3.0.0"
8+
sdk: ">=2.18.0 <3.0.0"
9+
flutter: ">=3.3.0"
1010

1111
flutter:
1212
plugin:

0 commit comments

Comments
 (0)