expo-location
Version:
Allows reading geolocation information from the device. Your app can poll for the current location or subscribe to location update events.
81 lines (80 loc) • 3.39 kB
TypeScript
import { ConfigPlugin } from 'expo/config-plugins';
type DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';
type dpiMap = Record<DPIString, {
folderName: string;
scale: number;
}>;
export declare const ANDROID_RES_PATH = "android/app/src/main/res/";
export declare const dpiValues: dpiMap;
export declare const FOREGROUND_SERVICE_ICON = "location_foreground_service_icon";
export declare const FOREGROUND_SERVICE_ICON_RESOURCE = "@drawable/location_foreground_service_icon";
export declare const META_DATA_FOREGROUND_SERVICE_ICON = "expo.modules.location.foreground_service_icon";
export declare const withForegroundServiceIcon: ConfigPlugin<{
icon: string | null;
}>;
/**
* Applies foreground service icon configuration for expo-location
*/
export declare function setForegroundServiceIconAsync(projectRoot: string, icon: string | null): Promise<void>;
export type Props = {
/**
* A string to set the `NSLocationAlwaysAndWhenInUseUsageDescription` permission message.
* @default "Allow $(PRODUCT_NAME) to use your location"
* @platform ios
*/
locationAlwaysAndWhenInUsePermission?: string | false;
/**
* A string to set the `NSLocationAlwaysUsageDescription` permission message.
* @default "Allow $(PRODUCT_NAME) to use your location"
* @platform ios
*/
locationAlwaysPermission?: string | false;
/**
* A string to set the `NSLocationWhenInUseUsageDescription` permission message.
* @default "Allow $(PRODUCT_NAME) to use your location"
* @platform ios
*/
locationWhenInUsePermission?: string | false;
/**
* A string to set the `NSMotionUsageDescription` permission message shown when
* `getMotionActivityAsync` or `watchMotionActivityAsync` is called for the first time.
* Set to `false` to omit the key. In that case, the app must add `NSMotionUsageDescription`
* manually to its `Info.plist`, for example via the `infoPlist` key in `app.json`.
* Without this key, calling motion activity APIs on iOS will throw an exception.
* @default "Allow $(PRODUCT_NAME) to detect your current motion activity"
* @platform ios
*/
motionUsagePermission?: string | false;
/**
* Whether to enable location in `UIBackgroundModes`.
* @default false
* @platform ios
*/
isIosBackgroundLocationEnabled?: boolean;
/**
* Whether to enable the `ACCESS_BACKGROUND_LOCATION` permission.
* @default false
* @platform android
*/
isAndroidBackgroundLocationEnabled?: boolean;
/**
* Whether to enable the `FOREGROUND_SERVICE` and `FOREGROUND_SERVICE_LOCATION` permissions.
* @default false
* @platform android
*/
isAndroidForegroundServiceEnabled?: boolean;
/**
* Whether to enable the `ACTIVITY_RECOGNITION` and `com.google.android.gms.permission.ACTIVITY_RECOGNITION`
* permissions required for motion activity tracking via `getMotionActivityAsync` and `watchMotionActivityAsync`.
* @default false
* @platform android
*/
isAndroidMotionActivityEnabled?: boolean;
/**
* Local path to an image for the foreground service icon. Should be a 96x96 all-white PNG with transparency.
* @platform android
*/
androidForegroundServiceIcon?: string;
};
declare const _default: ConfigPlugin<void | Props>;
export default _default;