Skip to content
ts
import { LocationServicesManager } from '@trail-run/core/device/location-services';

Class: LocationServicesManager

Defined in: src/device/location-services.ts:13

Manager for location services and permissions

Constructors

Constructor

ts
new LocationServicesManager(): LocationServicesManager;

Returns

LocationServicesManager

Methods

checkPermissionState()

ts
checkPermissionState(): Promise<LocationPermissionState>;

Defined in: src/device/location-services.ts:17

Check the current permission state for geolocation

Returns

Promise<LocationPermissionState>


disableLocationServices()

ts
disableLocationServices(): void;

Defined in: src/device/location-services.ts:84

Disable location services

Returns

void


getPlatformInstructions()

ts
getPlatformInstructions(): object;

Defined in: src/device/location-services.ts:93

Get platform-specific instructions for enabling location services

Returns

object

steps
ts
steps: string[];
title
ts
title: string;

requestPermission()

ts
requestPermission(backgroundAccess): Promise<LocationPermissionState>;

Defined in: src/device/location-services.ts:45

Request location permission

Parameters

backgroundAccess

boolean = false

Whether to request background location access (always vs while-using)

Returns

Promise<LocationPermissionState>

Released under the MIT License.