File tree Expand file tree Collapse file tree
packages/image_picker/image_picker_ios
ios/image_picker_ios/Sources/image_picker_ios Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 0.8.13+8
2+
3+ * Replaces deprecated ` kUTTypeImage ` and ` kUTTypeMovie ` with ` UTTypeImage ` and ` UTTypeMovie ` to fix iOS 15+ deprecation warnings.
4+
15## 0.8.13+7
26
37* Updates pigeon dev_dependency to ^27.3.2 for analyzer 14 compatibility.
Original file line number Diff line number Diff line change 1111#import < PhotosUI/PHPhotoLibrary+PhotosUISupport.h>
1212#import < PhotosUI/PhotosUI.h>
1313#import < UIKit/UIKit.h>
14+ #import < UniformTypeIdentifiers/UniformTypeIdentifiers.h>
1415
1516#import " ./include/image_picker_ios/messages.g.h"
1617#import " FLTImagePickerImageUtil.h"
@@ -127,10 +128,22 @@ - (void)launchUIImagePickerWithSource:(nonnull FLTSourceSpecification *)source
127128 imagePickerController.delegate = self;
128129 NSMutableArray <NSString *> *mediaTypes = [[NSMutableArray alloc ] init ];
129130 if (context.includeImages ) {
130- [mediaTypes addObject: (NSString *)kUTTypeImage ];
131+ NSString *imageType;
132+ if (@available (iOS 14.0 , *)) {
133+ imageType = UTTypeImage.identifier ;
134+ } else {
135+ imageType = (NSString *)kUTTypeImage ;
136+ }
137+ [mediaTypes addObject: imageType];
131138 }
132139 if (context.includeVideo ) {
133- [mediaTypes addObject: (NSString *)kUTTypeMovie ];
140+ NSString *movieType;
141+ if (@available (iOS 14.0 , *)) {
142+ movieType = UTTypeMovie.identifier ;
143+ } else {
144+ movieType = (NSString *)kUTTypeMovie ;
145+ }
146+ [mediaTypes addObject: movieType];
134147 imagePickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
135148 }
136149 imagePickerController.mediaTypes = mediaTypes;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: image_picker_ios
22description : iOS implementation of the image_picker plugin.
33repository : https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_ios
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
5- version : 0.8.13+7
5+ version : 0.8.13+8
66
77environment :
88 sdk : ^3.10.0
You can’t perform that action at this time.
0 commit comments