How to use the expo-location.isBackgroundLocationAvailableAsync function in expo-location

To help you get started, we’ve selected a few expo-location examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / expo-location_v5.x.x / flow_v0.104.x- / test_expo-location.js View on Github external
requestPermissionsAsync().then(result => {
    (result: void);

    // $ExpectError: check any
    (result: number);
  });

  hasServicesEnabledAsync().then(result => {
    (result: boolean);

    // $ExpectError: check any
    (result: number);
  });

  isBackgroundLocationAvailableAsync().then(result => {
    (result: boolean);

    // $ExpectError: check any
    (result: number);
  });

  geocodeAsync('address').then(result => {
    const geocodedLocation = result[0];

    (geocodedLocation.latitude: number);
    (geocodedLocation.longitude: number);
    (geocodedLocation.altitude: ?number);
    (geocodedLocation.accuracy: ?number);

    // $ExpectError: check any
    (geocodedLocation.latitude: string);
github expo / expo / home / screens / LocationDiagnosticsScreen.js View on Github external
async checkBackgroundLocationAvailability() {
    const isBackgroundLocationAvailable = await Location.isBackgroundLocationAvailableAsync();
    this.setState({ isBackgroundLocationAvailable });
  }