expo-image-picker 12.0.0 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 12.0.1 — 2021-12-15
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix unresolved promise when picker was dismissed with a swipe-down on iOS. ([#15511](https://github.com/expo/expo/pull/15511) by [@barthap](https://github.com/barthap))
18
+
13
19
  ## 12.0.0 — 2021-12-03
14
20
 
15
21
  ### 🛠 Breaking changes
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '12.0.0'
6
+ version = '12.0.1'
7
7
 
8
8
  buildscript {
9
9
  // Simple helper that allows the root project to override versions declared by this library.
@@ -58,7 +58,7 @@ android {
58
58
  minSdkVersion safeExtGet("minSdkVersion", 21)
59
59
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
60
60
  versionCode 22
61
- versionName "12.0.0"
61
+ versionName "12.0.1"
62
62
  }
63
63
  lintOptions {
64
64
  abortOnError false
@@ -7,6 +7,6 @@ typedef NS_ENUM(NSInteger, EXImagePickerTarget) {
7
7
  EXImagePickerTargetLibrarySingleImage,
8
8
  };
9
9
 
10
- @interface EXImagePicker : EXExportedModule <UINavigationControllerDelegate, UIImagePickerControllerDelegate, EXModuleRegistryConsumer>
10
+ @interface EXImagePicker : EXExportedModule <UIAdaptivePresentationControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, EXModuleRegistryConsumer>
11
11
 
12
12
  @end
@@ -213,6 +213,7 @@ EX_EXPORT_METHOD_AS(launchImageLibraryAsync, launchImageLibraryAsync:(NSDictiona
213
213
  self.picker.modalPresentationStyle = UIModalPresentationAutomatic;
214
214
  }
215
215
  self.picker.delegate = self;
216
+ self.picker.presentationController.delegate = self;
216
217
 
217
218
  [self maybePreserveVisibilityAndHideStatusBar:[[self.options objectForKey:@"allowsEditing"] boolValue]];
218
219
  id<EXUtilitiesInterface> utils = [self.moduleRegistry getModuleImplementingProtocol:@protocol(EXUtilitiesInterface)];
@@ -458,6 +459,7 @@ EX_EXPORT_METHOD_AS(launchImageLibraryAsync, launchImageLibraryAsync:(NSDictiona
458
459
  [response setObject:exif forKey:@"exif"];
459
460
  }
460
461
 
462
+ // called when user pressed cancel button
461
463
  - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
462
464
  {
463
465
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -468,6 +470,12 @@ EX_EXPORT_METHOD_AS(launchImageLibraryAsync, launchImageLibraryAsync:(NSDictiona
468
470
  });
469
471
  }
470
472
 
473
+ // called when user dismissed modal with swipe-down
474
+ - (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController {
475
+ [self maybeRestoreStatusBarVisibility];
476
+ self.resolve(@{@"cancelled": @YES});
477
+ }
478
+
471
479
  - (void)maybePreserveVisibilityAndHideStatusBar:(BOOL)editingEnabled
472
480
  {
473
481
  // As of iOS 11, launching ImagePicker with `allowsEditing` option makes cropping rectangle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-image-picker",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "Provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.",
5
5
  "main": "build/ImagePicker.js",
6
6
  "types": "build/ImagePicker.d.ts",
@@ -45,5 +45,5 @@
45
45
  "peerDependencies": {
46
46
  "expo": "*"
47
47
  },
48
- "gitHead": "2e5c6983b86d5ecfca028ba64002897d8adc2cc4"
48
+ "gitHead": "779a011c9a6a436d3e69df0f8f7d1a4703fb297a"
49
49
  }