Skip to content

Commit b761532

Browse files
stuartmorgan-gmauricioluz
authored andcommitted
[ci] Updates iOS deprecation check to iOS 13 (flutter#5786)
1 parent d7bdcb9 commit b761532

File tree

12 files changed

+92
-32
lines changed

12 files changed

+92
-32
lines changed

.cirrus.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,7 @@ task:
336336
- ./script/tool_runner.sh xcode-analyze --ios
337337
xcode_analyze_deprecation_script:
338338
# Ensure we don't accidentally introduce deprecated code.
339-
# TODO(stuartmorgan): Update this to a newer version of iOS to get
340-
# ahead of upcoming deprecations.
341-
- ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=11.0
339+
- ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=13.0
342340
native_test_script:
343341
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
344342
drive_script:

packages/google_sign_in/google_sign_in_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.3.1
2+
3+
* Suppresses warnings for pre-iOS-13 codepaths.
4+
15
## 5.3.0
26

37
* Supports arm64 iOS simulators by increasing GoogleSignIn dependency to version 6.2.

packages/google_sign_in/google_sign_in_ios/example/ios/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2727

2828
# Suppress warnings from transitive dependencies that cause analysis to fail.
2929
pod 'AppAuth', :inhibit_warnings => true
30+
pod 'GTMAppAuth', :inhibit_warnings => true
3031

3132
flutter_ios_podfile_setup
3233

packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,13 @@ - (void)respondWithAccount:(NSDictionary<NSString *, id> *)account
252252
}
253253

254254
- (UIViewController *)topViewController {
255+
#pragma clang diagnostic push
256+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
257+
// TODO(stuartmorgan) Provide a non-deprecated codepath. See
258+
// https://github.com/flutter/flutter/issues/104117
255259
return [self topViewControllerFromViewController:[UIApplication sharedApplication]
256260
.keyWindow.rootViewController];
261+
#pragma clang diagnostic pop
257262
}
258263

259264
/**

packages/google_sign_in/google_sign_in_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_sign_in_ios
22
description: iOS implementation of the google_sign_in plugin.
33
repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
5-
version: 5.3.0
5+
version: 5.3.1
66

77
environment:
88
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.5+5
2+
3+
* Adds non-deprecated codepaths for iOS 13+.
4+
15
## 0.8.5+4
26

37
* Suppresses warnings for pre-iOS-11 codepaths.

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

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -567,18 +567,38 @@ - (void)imagePickerController:(UIImagePickerController *)picker
567567
// Image picked without an original asset (e.g. User took a photo directly)
568568
[self saveImageWithPickerInfo:info image:image imageQuality:desiredImageQuality];
569569
} else {
570-
[[PHImageManager defaultManager]
571-
requestImageDataForAsset:originalAsset
572-
options:nil
573-
resultHandler:^(NSData *_Nullable imageData, NSString *_Nullable dataUTI,
574-
UIImageOrientation orientation, NSDictionary *_Nullable info) {
575-
// maxWidth and maxHeight are used only for GIF images.
576-
[self saveImageWithOriginalImageData:imageData
577-
image:image
578-
maxWidth:maxWidth
579-
maxHeight:maxHeight
580-
imageQuality:desiredImageQuality];
581-
}];
570+
void (^resultHandler)(NSData *imageData, NSString *dataUTI, NSDictionary *info) = ^(
571+
NSData *_Nullable imageData, NSString *_Nullable dataUTI, NSDictionary *_Nullable info) {
572+
// maxWidth and maxHeight are used only for GIF images.
573+
[self saveImageWithOriginalImageData:imageData
574+
image:image
575+
maxWidth:maxWidth
576+
maxHeight:maxHeight
577+
imageQuality:desiredImageQuality];
578+
};
579+
if (@available(iOS 13.0, *)) {
580+
[[PHImageManager defaultManager]
581+
requestImageDataAndOrientationForAsset:originalAsset
582+
options:nil
583+
resultHandler:^(NSData *_Nullable imageData,
584+
NSString *_Nullable dataUTI,
585+
CGImagePropertyOrientation orientation,
586+
NSDictionary *_Nullable info) {
587+
resultHandler(imageData, dataUTI, info);
588+
}];
589+
} else {
590+
#pragma clang diagnostic push
591+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
592+
[[PHImageManager defaultManager]
593+
requestImageDataForAsset:originalAsset
594+
options:nil
595+
resultHandler:^(NSData *_Nullable imageData, NSString *_Nullable dataUTI,
596+
UIImageOrientation orientation,
597+
NSDictionary *_Nullable info) {
598+
resultHandler(imageData, dataUTI, info);
599+
}];
600+
#pragma clang diagnostic pop
601+
}
582602
}
583603
}
584604
}

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

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,39 @@ - (void)processImage:(UIImage *)localImage API_AVAILABLE(ios(14)) {
122122
isMetadataAvailable:originalAsset != nil];
123123
}
124124
if (originalAsset) {
125-
[[PHImageManager defaultManager]
126-
requestImageDataForAsset:originalAsset
127-
options:nil
128-
resultHandler:^(NSData *_Nullable imageData, NSString *_Nullable dataUTI,
129-
UIImageOrientation orientation, NSDictionary *_Nullable info) {
130-
// maxWidth and maxHeight are used only for GIF images.
131-
NSString *savedPath = [FLTImagePickerPhotoAssetUtil
132-
saveImageWithOriginalImageData:imageData
133-
image:localImage
134-
maxWidth:self.maxWidth
135-
maxHeight:self.maxHeight
136-
imageQuality:self.desiredImageQuality];
137-
[self completeOperationWithPath:savedPath];
138-
}];
125+
void (^resultHandler)(NSData *imageData, NSString *dataUTI, NSDictionary *info) =
126+
^(NSData *_Nullable imageData, NSString *_Nullable dataUTI, NSDictionary *_Nullable info) {
127+
// maxWidth and maxHeight are used only for GIF images.
128+
NSString *savedPath = [FLTImagePickerPhotoAssetUtil
129+
saveImageWithOriginalImageData:imageData
130+
image:localImage
131+
maxWidth:self.maxWidth
132+
maxHeight:self.maxHeight
133+
imageQuality:self.desiredImageQuality];
134+
[self completeOperationWithPath:savedPath];
135+
};
136+
if (@available(iOS 13.0, *)) {
137+
[[PHImageManager defaultManager]
138+
requestImageDataAndOrientationForAsset:originalAsset
139+
options:nil
140+
resultHandler:^(NSData *_Nullable imageData,
141+
NSString *_Nullable dataUTI,
142+
CGImagePropertyOrientation orientation,
143+
NSDictionary *_Nullable info) {
144+
resultHandler(imageData, dataUTI, info);
145+
}];
146+
} else {
147+
#pragma clang diagnostic push
148+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
149+
[[PHImageManager defaultManager]
150+
requestImageDataForAsset:originalAsset
151+
options:nil
152+
resultHandler:^(NSData *_Nullable imageData, NSString *_Nullable dataUTI,
153+
UIImageOrientation orientation, NSDictionary *_Nullable info) {
154+
resultHandler(imageData, dataUTI, info);
155+
}];
156+
#pragma clang diagnostic pop
157+
}
139158
} else {
140159
// Image picked without an original asset (e.g. User pick image without permission)
141160
NSString *savedPath =

packages/image_picker/image_picker_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker_ios
22
description: iOS implementation of the video_picker plugin.
33
repository: https://github.com/flutter/plugins/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.5+4
5+
version: 0.8.5+5
66

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

packages/url_launcher/url_launcher_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.0.17
2+
3+
* Suppresses warnings for pre-iOS-13 codepaths.
4+
15
## 6.0.16
26

37
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors

packages/url_launcher/url_launcher_ios/ios/Classes/FLTURLLauncherPlugin.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,13 @@ - (void)closeWebViewWithResult:(FlutterResult)result API_AVAILABLE(ios(9.0)) {
136136
}
137137

138138
- (UIViewController *)topViewController {
139+
#pragma clang diagnostic push
140+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
141+
// TODO(stuartmorgan) Provide a non-deprecated codepath. See
142+
// https://github.com/flutter/flutter/issues/104117
139143
return [self topViewControllerFromViewController:[UIApplication sharedApplication]
140144
.keyWindow.rootViewController];
145+
#pragma clang diagnostic pop
141146
}
142147

143148
/**

packages/url_launcher/url_launcher_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: url_launcher_ios
22
description: iOS implementation of the url_launcher plugin.
33
repository: https://github.com/flutter/plugins/tree/main/packages/url_launcher/url_launcher_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
5-
version: 6.0.16
5+
version: 6.0.17
66

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

0 commit comments

Comments
 (0)