How to use the expo-location.stopGeofencingAsync 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
it('should raise an error when call function with invalid arguments', () => {
    // $ExpectError: need a string
    stopGeofencingAsync(69);
  });
});
github flow-typed / flow-typed / definitions / npm / expo-location_v5.x.x / flow_v0.104.x- / test_expo-location.js View on Github external
it('should passes when used properly', () => {
    stopGeofencingAsync('taskName').then(result => {
      (result: void);

      // $ExpectError: check any
      (result: string);
    });
  });
github expo / expo / home / screens / GeofencingScreen.js View on Github external
toggleGeofencing = async () => {
    if (!this.canToggleGeofencing()) {
      return;
    }

    if (this.state.isGeofencing) {
      await Location.stopGeofencingAsync(GEOFENCING_TASK);
      this.setState({ geofencingRegions: [] });
    } else {
      await Location.startGeofencingAsync(GEOFENCING_TASK, this.state.geofencingRegions);
      alert(
        'You will be receiving notifications when the device enters or exits from selected regions.'
      );
    }
    this.setState(state => ({ isGeofencing: !state.isGeofencing }));
  };
github expo / expo / apps / native-component-list / src / screens / Location / GeofencingScreen.tsx View on Github external
toggleGeofencing = async () => {
    if (this.state.isGeofencing) {
      await Location.stopGeofencingAsync(GEOFENCING_TASK);
      this.setState({ geofencingRegions: [] });
    } else {
      await Location.startGeofencingAsync(GEOFENCING_TASK, this.state.geofencingRegions);
    }
    this.setState({ isGeofencing: !this.state.isGeofencing });
  }