Options
All
  • Public
  • Public/Protected
  • All
Menu

The event-object provided to BackgroundGeolocation.onProviderChange

example
BackgroundGeolocation.onProviderChange(providerChangeEvent => {
  console.log("[providerchange] ", provider.enabled, provider.status, provider.network, provider.gps);
});

Hierarchy

  • ProviderChangeEvent

Index

Properties

accuracyAuthorization

accuracyAuthorization: AccuracyAuthorization

[iOS 14+] iOS 14 has introduced a new [Precise: On] switch on the location authorization dialog allowing users to disable high-accuracy location.

This attribute shows the state of that switch:

example
BackgroundGeolocation.onProviderChange((event) => {
  let authorizationStatus = event.authorizationStatus;
  if (authorizationStatus == BackgroundGeolocation.ACCURACY_AUTHORIZATION_REDUCED) {
    // Supply "Purpose" key from Info.plist as 1st argument.
    BackgroundGeolocaiton.requestTemporaryFullAccuracy("Delivery").then((accuracyAuthorization) => {
      console.log("[requestTemporaryFullAccuracy]: ", accuracyAuthorization);
    }).catch((error) => {
      console.warn("[requestTemporaryFullAccuracy] ERROR:", error);
    });
  }
});

See also:

enabled

enabled: boolean

true When device location-services are enabled.

gps

gps: boolean

true if GPS geolocation provider is available.

network

network: boolean

true if network geolocation provider is available.

status

Authorization status of location-services. For iOS, this will tell you if the user has enabled "Always" or "When in Use" authorization.

Name Platform
AUTHORIZATION_STATUS_NOT_DETERMINED iOS only
AUTHORIZATION_STATUS_RESTRICTED iOS only
AUTHORIZATION_STATUS_DENIED iOS & Android
AUTHORIZATION_STATUS_ALWAYS iOS & Android
AUTHORIZATION_STATUS_WHEN_IN_USE iOS only

ℹ️ Note:

Generated using TypeDoc