dpogue commented on code in PR #937:
URL: 
https://github.com/apache/cordova-plugin-camera/pull/937#discussion_r2590338976


##########
src/ios/CDVCamera.h:
##########
@@ -21,6 +21,7 @@
 #import <CoreLocation/CoreLocation.h>
 #import <CoreLocation/CLLocationManager.h>
 #import <Cordova/CDVPlugin.h>
+#import <PhotosUI/PhotosUI.h>

Review Comment:
   I think this import needs to be guarded by
   ```objc
   #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
   ```



##########
tests/ios/CDVCameraTest/CDVCameraLibTests/CameraTest.m:
##########
@@ -22,6 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one
 #import "CDVCamera.h"
 #import "UIImage+CropScaleOrientation.h"
 #import <MobileCoreServices/UTCoreTypes.h>
+#import <PhotosUI/PhotosUI.h>

Review Comment:
   I think this include might need to be guarded
   ```objc
   #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
   ```



##########
src/ios/CDVCamera.m:
##########
@@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one
 #import <MobileCoreServices/UTCoreTypes.h>
 #import <objc/message.h>
 #import <Photos/Photos.h>
+#import <PhotosUI/PhotosUI.h>

Review Comment:
   I think this import needs to be guarded by
   ```objc
   #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
   ```



##########
src/ios/CDVCamera.m:
##########
@@ -242,6 +266,38 @@ - (void)showCameraPicker:(NSString*)callbackId 
withOptions:(CDVPictureOptions *)
     });
 }
 
+// Since iOS 14, we can use PHPickerViewController to select images from the 
photo library
+- (void)showPHPicker:(NSString*)callbackId 
withOptions:(CDVPictureOptions*)pictureOptions API_AVAILABLE(ios(14))
+{
+    PHPickerConfiguration *config = [[PHPickerConfiguration alloc] init];

Review Comment:
   I think all the implementation inside this method might need to be guarded by
   ```objc
   #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
   ```
   
   It's not entirely clear to me if `API_AVAILABLE(ios(14))` will be sufficient 
to prevent a compiler from seeing this when targeting an older SDK



##########
src/ios/CDVCamera.m:
##########
@@ -898,6 +954,152 @@ - (void)imagePickerControllerReturnImageResult
     }
 }
 
+// PHPickerViewController Delegate Methods (iOS 14+)

Review Comment:
   I think these method declarations might need to be guarded
   ```objc
   #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to