Utilisation

Persist each batch of positions delivered to a background location task.

tsx
// Persist each batch of positions delivered to a background location task.
import { location, storage } from 'kuito';

location.defineUpdates('trip', async (run: location.LocationTaskRun) => {
  await storage.set('latest-trip-batch', JSON.stringify(run.locations));
});
// Register at module scope. Declare background location and obtain permission
// before calling location.startUpdates('trip').

Déclaration du type

ts
export type LocationTaskRun = {
  name: string;
  /** When the platform stops waiting for the run, in milliseconds since the epoch. */
  deadline: number;
  locations: LocationObject[];
};

Membres 3

NomTypeRequisDescription
namestringOui—
deadlinenumberOuiWhen the platform stops waiting for the run, in milliseconds since the epoch.
locationsFix[]Oui—
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.