Skip to content

Commit

Permalink
fix: Rename enableLocationPermission to enableLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed May 3, 2024
1 parent d45c1c6 commit f8b40fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion package/src/expo-plugin/@types.ts
Expand Up @@ -11,9 +11,11 @@ export type ConfigProps = {
enableMicrophonePermission?: boolean
/**
* Whether to add Location Permissions to the native manifest or not.
*
* On iOS, this also fully removes the location-related APIs (`CLLocationManager`) from the compiled app.
* @default false
*/
enableLocationPermission?: boolean
enableLocation?: boolean
/**
* The text to show in the native dialog when asking for Microphone Permissions.
* @default 'Allow $(PRODUCT_NAME) to access your microphone'
Expand Down
8 changes: 4 additions & 4 deletions package/src/expo-plugin/withVisionCamera.ts
Expand Up @@ -23,18 +23,18 @@ const withCamera: ConfigPlugin<ConfigProps> = (config, props = {}) => {
config.ios.infoPlist.NSMicrophoneUsageDescription =
props.microphonePermissionText ?? (config.ios.infoPlist.NSMicrophoneUsageDescription as string | undefined) ?? MICROPHONE_USAGE
}
if (props.enableLocationPermission) {
if (props.enableLocation) {
// Location permission
config.ios.infoPlist.NSLocationWhenInUseUsageDescription =
props.locationPermissionText ?? (config.ios.infoPlist.NSLocationWhenInUseUsageDescription as string | undefined) ?? LOCATION_USAGE
}
const androidPermissions = ['android.permission.CAMERA']
if (props.enableMicrophonePermission) androidPermissions.push('android.permission.RECORD_AUDIO')
if (props.enableLocationPermission) androidPermissions.push('android.permission.ACCESS_FINE_LOCATION')
if (props.enableLocation) androidPermissions.push('android.permission.ACCESS_FINE_LOCATION')

if (props.enableLocationPermission != null) {
if (props.enableLocation != null) {
// set Podfile property to build location-related stuff
config = withEnableLocationIOS(config, props.enableLocationPermission)
config = withEnableLocationIOS(config, props.enableLocation)
}
if (props.enableFrameProcessors != null) {
// set Podfile property to build frame-processor-related stuff
Expand Down

0 comments on commit f8b40fd

Please sign in to comment.