Skip to content

Commit

Permalink
Merge branch 'main' into cipolleschi/fix-react-native-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Nov 23, 2023
2 parents 3201004 + 5a79ea8 commit 35f664c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ios/ImagePickerManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ - (void)launchImagePicker:(NSDictionary *)options callback:(RCTResponseSenderBlo
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[ImagePickerUtils setupPickerFromOptions:picker options:self.options target:target];
picker.delegate = self;

picker.presentationController.delegate = self;

if([self.options[@"includeExtra"] boolValue]) {
[self checkPhotosPermissions:^(BOOL granted) {
if (!granted) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-image-picker",
"version": "7.0.2",
"version": "7.0.3",
"description": "A React Native module that allows you to use native UI to select media from the device library or directly from the camera",
"react-native": "src/index.ts",
"main": "src/index.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/platforms/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DEFAULT_OPTIONS: ImageLibraryOptions & CameraOptions = {
// @ts-ignore We want to check whether __turboModuleProxy exitst, it may not
const isTurboModuleEnabled = global.__turboModuleProxy != null;

const nativeImagePicler = isTurboModuleEnabled ?
const nativeImagePicker = isTurboModuleEnabled ?
require("./NativeImagePicker").default :
NativeModules.ImagePicker;

Expand All @@ -35,7 +35,7 @@ export function camera(
callback?: Callback,
): Promise<ImagePickerResponse> {
return new Promise((resolve) => {
nativeImagePicler.launchCamera(
nativeImagePicker.launchCamera(
{...DEFAULT_OPTIONS, ...options},
(result: ImagePickerResponse) => {
if (callback) callback(result);
Expand All @@ -50,7 +50,7 @@ export function imageLibrary(
callback?: Callback,
): Promise<ImagePickerResponse> {
return new Promise((resolve) => {
nativeImagePicler.launchImageLibrary(
nativeImagePicker.launchImageLibrary(
{...DEFAULT_OPTIONS, ...options},
(result: ImagePickerResponse) => {
if (callback) callback(result);
Expand Down

0 comments on commit 35f664c

Please sign in to comment.