@connectedbits/react-native-image-picker 2.4.13-android-legacy → 2.4.15-android-legacy

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.
@@ -285,12 +285,6 @@ public class ImagePickerModule extends ReactContextBaseJavaModule
285
285
  cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, cameraCaptureURI);
286
286
  }
287
287
 
288
- if (cameraIntent.resolveActivity(reactContext.getPackageManager()) == null)
289
- {
290
- responseHelper.invokeError(callback, "Cannot launch camera");
291
- return;
292
- }
293
-
294
288
  // Workaround for Android bug.
295
289
  // grantUriPermission also needed for KITKAT,
296
290
  // see https://code.google.com/p/android/issues/detail?id=76683
@@ -309,7 +303,7 @@ public class ImagePickerModule extends ReactContextBaseJavaModule
309
303
  catch (ActivityNotFoundException e)
310
304
  {
311
305
  e.printStackTrace();
312
- responseHelper.invokeError(callback, "Cannot launch camera");
306
+ responseHelper.invokeError(callback, "Cannot launch camera, unable to start");
313
307
  }
314
308
  }
315
309
 
@@ -364,12 +358,6 @@ public class ImagePickerModule extends ReactContextBaseJavaModule
364
358
  }
365
359
  }
366
360
 
367
- if (libraryIntent.resolveActivity(reactContext.getPackageManager()) == null)
368
- {
369
- responseHelper.invokeError(callback, "Cannot launch photo library");
370
- return;
371
- }
372
-
373
361
  try
374
362
  {
375
363
  String chooseWhichLibraryTitle = null;
@@ -711,23 +699,27 @@ public class ImagePickerModule extends ReactContextBaseJavaModule
711
699
 
712
700
  private void parseOptions(final ReadableMap options) {
713
701
  noData = false;
702
+ pickVideo = false;
703
+ pickBoth = false;
704
+ videoQuality = 1;
705
+ videoDurationLimit = 0;
706
+ if(options == null){
707
+ return;
708
+ }
709
+
714
710
  if (options.hasKey("noData")) {
715
711
  noData = options.getBoolean("noData");
716
712
  }
717
713
  imageConfig = imageConfig.updateFromOptions(options);
718
- pickVideo = false;
719
- pickBoth = false;
720
714
  if (options.hasKey("mediaType") && options.getString("mediaType").equals("mixed")) {
721
715
  pickBoth = true;
722
716
  }
723
717
  if (options.hasKey("mediaType") && options.getString("mediaType").equals("video")) {
724
718
  pickVideo = true;
725
719
  }
726
- videoQuality = 1;
727
720
  if (options.hasKey("videoQuality") && options.getString("videoQuality").equals("low")) {
728
721
  videoQuality = 0;
729
722
  }
730
- videoDurationLimit = 0;
731
723
  if (options.hasKey("durationLimit")) {
732
724
  videoDurationLimit = options.getInt("durationLimit");
733
725
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedbits/react-native-image-picker",
3
- "version": "2.4.13-android-legacy",
3
+ "version": "2.4.15-android-legacy",
4
4
  "description": "A React Native module that allows you to use native UI to select media from the device library or directly from the camera",
5
5
  "react-native": "src/index.ts",
6
6
  "types": "lib/typescript/index.d.ts",