@supportworks/multi-imagepicker 8.3.3 → 8.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supportworks/multi-imagepicker",
3
- "version": "8.3.3",
3
+ "version": "8.3.4",
4
4
  "description": "Android and iOS customized multiple image picker. For react-native >= 0.60.",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -248,7 +248,7 @@ const MultiImagePicker = forwardRef((props, ref) => {
248
248
  }
249
249
  }, [maxCount, requestCameraPermission, showPermissionAlert])
250
250
 
251
- const usePicker = useCallback((index, cancelIndex) => {
251
+ const usePicker = useCallback(async (index, cancelIndex) => {
252
252
  // index: index of ActionSheet. Depends on whether custom buttons added. Last 3 are fixed (Take Photo, Choose from Library, Cancel). Anything before that is custom button.
253
253
  // Custom buttons can be sent using customButtons prop.
254
254
  // results - sets cRef.imgArr to an array of image info that the picker library provided
@@ -276,6 +276,11 @@ const MultiImagePicker = forwardRef((props, ref) => {
276
276
 
277
277
  // Use CameraModal on iOS 26+, native camera on Android
278
278
  if (Platform.OS === 'ios' && parseInt(Platform.Version,10) >= 26) {
279
+ const hasPermission = await requestCameraPermission()
280
+ if (!hasPermission) {
281
+ showPermissionAlert('Camera')
282
+ break
283
+ }
279
284
  setPendingPickerIndex(index)
280
285
  setPendingCancelIndex(cancelIndex)
281
286
  setShowCameraModal(true)
@@ -318,7 +323,7 @@ const MultiImagePicker = forwardRef((props, ref) => {
318
323
  console.log('----usePicker User pressed custom button')
319
324
  pickerDone(index, cancelIndex)
320
325
  }
321
- }, [checkAndOpenPicker, maxCount, pickerDone, takeOnePicture])
326
+ }, [checkAndOpenPicker, maxCount, pickerDone, requestCameraPermission, showPermissionAlert, takeOnePicture])
322
327
 
323
328
  const showActionSheet = useCallback(() => {
324
329
  if (actionSheetRef.current && typeof actionSheetRef.current.show === 'function') {