React Native Location
    Preparing search index...

    Type Alias ConfigureOptions

    This configuration is used for location-tracking. It contains platform-specific configurations.

    {
    allowsBackgroundLocationUpdates: false,
    distanceFilter: 0,
    notificationMandatory: false,
    notification: {
    icon: 'ic_launcher',
    title: 'Location Service Running',
    content: 'Location is being used by the app.',
    },
    android: {
    priority: 'highAccuracy',
    provider: 'auto',
    interval: 5000,
    minWaitTime: undefined,
    maxWaitTime: undefined,
    },
    ios: {
    desiredAccuracy: 'best',
    activityType: 'other',
    headingFilter: 0,
    headingOrientation: 'portrait',
    pausesLocationUpdatesAutomatically: false,
    showsBackgroundLocationIndicator: false,
    },
    }
    type ConfigureOptions = {
        allowsBackgroundLocationUpdates?: boolean;
        android?: {
            interval?: number;
            maxWaitTime?: number;
            minWaitTime?: number;
            priority?: AndroidPriority;
            provider?: AndroidProvider;
        };
        distanceFilter?: number;
        ios?: {
            activityType?: IosActivityType;
            desiredAccuracy?: IosAccuracy;
            headingFilter?: number;
            headingOrientation?: IosHeadingOrientation;
            pausesLocationUpdatesAutomatically?: boolean;
            showsBackgroundLocationIndicator?: boolean;
        };
        notification?: LocationNotification;
        notificationMandatory?: boolean;
    }
    Index

    Properties

    allowsBackgroundLocationUpdates?: boolean

    A Boolean value indicating whether the app should receive location updates when suspended. Requires permissions to always access the users location.

    android ios

    false
    
    android?: {
        interval?: number;
        maxWaitTime?: number;
        minWaitTime?: number;
        priority?: AndroidPriority;
        provider?: AndroidProvider;
    }

    Type Declaration

    • Optionalinterval?: number

      The desired interval for active location updates, in milliseconds.

      android

      5000
      
    • OptionalmaxWaitTime?: number

      Sets the maximum wait time in milliseconds for location updates.

      If you pass a value at least 2x larger than the interval specified with setInterval(long), then location delivery may be delayed and multiple locations can be delivered at once.

      android

    • OptionalminWaitTime?: number

      Explicitly set the fastest interval for location updates, in milliseconds.

      This controls the fastest rate at which your application will receive location updates, which might be faster than interval in some situations (for example, if other applications are triggering location updates).

      This allows your application to passively acquire locations at a rate faster than it actively acquires locations, saving power.

      android

    • Optionalpriority?: AndroidPriority

      The accuracy of the location data.

      android

      'highAccuracy'
      
    • Optionalprovider?: AndroidProvider

      The provider which is used on Android to get the location. Your app must include the Google Play services dependencies to use the playServices location provider. By default it will choose the playServices location provider if it detects that the dependencies are installed, otherwise, it will use the standard Android version which does not require Google Play Services to be installed.

      android

      'auto'
      
    distanceFilter?: number

    The minimum distance in meters that the device location needs to change before the location update callback in your app is called.

    android ios

    0
    
    ios?: {
        activityType?: IosActivityType;
        desiredAccuracy?: IosAccuracy;
        headingFilter?: number;
        headingOrientation?: IosHeadingOrientation;
        pausesLocationUpdatesAutomatically?: boolean;
        showsBackgroundLocationIndicator?: boolean;
    }

    Type Declaration

    • OptionalactivityType?: IosActivityType

      The type of user activity associated with the location updates.

      ios

      'other'
      
    • OptionaldesiredAccuracy?: IosAccuracy

      The accuracy of the location data.

      ios

      'best'
      
    • OptionalheadingFilter?: number

      The minimum angle in degrees that the device heading needs to change before the heading update callback in your app is called.

      ios

      0
      
    • OptionalheadingOrientation?: IosHeadingOrientation

      The device orientation to use when computing heading values.

      ios

      'portrait'
      
    • OptionalpausesLocationUpdatesAutomatically?: boolean

      A Boolean value indicating whether the location manager object may pause location updates.

      ios

      false
      
    • OptionalshowsBackgroundLocationIndicator?: boolean

      A Boolean indicating whether the status bar changes its appearance when location services are used in the background. Only works on iOS 11+ and is ignored for earlier versions of iOS.

      ios

      false
      
    notification?: LocationNotification

    Information regarding the notification to be displayed.

    {
    icon: 'ic_launcher',
    title: 'Location Service Running',
    content: 'Location is being used by the app.',
    }
    notificationMandatory?: boolean

    Important if you are doing location-tracking in the background. When location tracking is started in the background, a notification is shown to the user. This notification is important to prevent Android "foreground-service" from dying. When true, it will require notification permission to be granted for Android and iOS.

    false