"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useCameraPermission = void 0;
var _reactNative = require("react-native");
const useCameraPermission = () => {
  const requestCameraPermission = async () => {
    if (_reactNative.Platform.OS === 'android') {
      try {
        const granted = await _reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.CAMERA, {
          title: 'Camera Permission',
          message: 'App needs camera permission to take photos',
          buttonNeutral: 'Ask Me Later',
          buttonNegative: 'Cancel',
          buttonPositive: 'OK'
        });
        return granted === _reactNative.PermissionsAndroid.RESULTS.GRANTED;
      } catch (err) {
        return false;
      }
    }
    return true; // iOS handles permissions automatically through Info.plist
  };
  const getCameraPermission = async () => {
    const permission = await requestCameraPermission();
    return permission;
  };
  return {
    getCameraPermission
  };
};
exports.useCameraPermission = useCameraPermission;
//# sourceMappingURL=usePermissions.js.map