Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fd62211
Fix handler method to get preferred camera device
ydag May 17, 2021
aaa4a39
Update the version number
ydag May 17, 2021
9c021ad
Add description into the CHANGELOG.md file
ydag May 17, 2021
877b0d8
Fix an issue when camera is chosen
ydag May 17, 2021
3a75fe8
Merge branch 'master' into image_picker_fix_camera_device
ydag May 18, 2021
00213eb
Update the version number
ydag May 18, 2021
5b7ff47
Add helper method to get camera device
ydag May 19, 2021
b548492
Refactor to get preferred camera device
ydag May 19, 2021
9b8b882
Fix team selection in XCTest signing
ydag May 19, 2021
4ffe307
Merge branch 'master' into image_picker_fix_camera_device
ydag May 20, 2021
2313548
Update the version number
ydag May 20, 2021
00ae1ff
Remove unnecessary curly brackets
ydag May 26, 2021
30d61c7
Remove unnecessary curly brackets
ydag May 26, 2021
ceb2577
Add local variable to call method only once
ydag May 26, 2021
4398ae6
Add a declaration comment
ydag May 27, 2021
22b684a
Fix the method call
ydag May 27, 2021
c93a157
Revert "Fix an issue when camera is chosen"
ydag May 27, 2021
3760e13
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 1, 2021
72bdca4
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 3, 2021
23f4d8a
Update the comment
ydag Jun 3, 2021
f8fa19d
Add OCMock to the RunnerUITests
ydag Jun 3, 2021
b5710fb
Refactor unit tests with OCMock implementation
ydag Jun 3, 2021
dc7c3b6
Update the podfile
ydag Jun 3, 2021
8ef3516
Add libOCMock.a in Link Binary With Libraries
ydag Jun 3, 2021
3f7d062
Revert "Add libOCMock.a in Link Binary With Libraries"
ydag Jun 3, 2021
311caf5
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 3, 2021
04b8e74
Update CHANGELOG file
ydag Jun 3, 2021
46c1e7d
Refactor Podfile to add OCMock under RunnerTests
ydag Jun 3, 2021
c27a3f3
Add AVCaptureDevice mock
ydag Jun 4, 2021
397f053
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 8, 2021
27df40e
Update version number
ydag Jun 8, 2021
b24e5c0
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 8, 2021
1c3db4c
Update version number
ydag Jun 8, 2021
9277b82
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 21, 2021
290ca88
Remove self-explanatory comments
ydag Jun 21, 2021
7467883
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 22, 2021
0ec6cc8
Update the version number
ydag Jun 22, 2021
6b82355
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 23, 2021
9ffa039
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 25, 2021
bf8bd36
Update the version number
ydag Jun 25, 2021
5a14280
Remove tearDown method
ydag Jun 28, 2021
6fe570f
Convert true to YES
ydag Jun 28, 2021
4927206
Add blank after pragma mark
ydag Jun 28, 2021
84b3e65
Refactor to return AVAuthorizationStatus constant
ydag Jun 28, 2021
6294377
Fix the comment
ydag Jun 28, 2021
2800919
Add a comment
ydag Jun 30, 2021
b0022f6
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 30, 2021
8108389
Update the version number
ydag Jun 30, 2021
5d7181b
Fix comments
ydag Jun 30, 2021
e65ce44
Merge branch 'master' into image_picker_fix_camera_device
ydag Jun 30, 2021
8634c68
Update version number
ydag Jun 30, 2021
307757c
Update the comment
ydag Jul 9, 2021
a2b22d6
Merge branch 'master' into image_picker_fix_camera_device
ydag Jul 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add helper method to get camera device
  • Loading branch information
ydag committed May 19, 2021
commit 5b7ff47bfd84073792befa6d4a7381bf506a471d
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ - (UIViewController *)viewControllerWithWindow:(UIWindow *)window {
return topController;
}

- (UIImagePickerControllerCameraDevice)getCameraDevice:(NSDictionary *)arguments {
NSInteger cameraDevice = [[arguments objectForKey:@"cameraDevice"] intValue];
return (cameraDevice == 1) ? UIImagePickerControllerCameraDeviceFront
: UIImagePickerControllerCameraDeviceRear;
}

- (void)pickImageWithPHPicker:(bool)single API_AVAILABLE(ios(14)) {
PHPickerConfiguration *config =
[[PHPickerConfiguration alloc] initWithPhotoLibrary:PHPhotoLibrary.sharedPhotoLibrary];
Expand All @@ -91,9 +97,7 @@ - (void)pickImageWithUIImagePicker {

switch (imageSource) {
case SOURCE_CAMERA: {
NSInteger cameraDevice = [[_arguments objectForKey:@"cameraDevice"] intValue];
_device = (cameraDevice == 1) ? UIImagePickerControllerCameraDeviceFront
: UIImagePickerControllerCameraDeviceRear;
_device = [self getCameraDevice:_arguments];
[self checkCameraAuthorization];
break;
}
Expand Down Expand Up @@ -159,9 +163,7 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result

switch (imageSource) {
case SOURCE_CAMERA: {
NSInteger cameraDevice = [[_arguments objectForKey:@"cameraDevice"] intValue];
_device = (cameraDevice == 1) ? UIImagePickerControllerCameraDeviceFront
: UIImagePickerControllerCameraDeviceRear;
_device = [self getCameraDevice:_arguments];
[self checkCameraAuthorization];
break;
}
Expand Down