hammerspoon2-docs
    Preparing search index...

    Class HSLocationWatcher

    An independent location tracking object. Create via hs.location.addWatcher(). Call start() to begin receiving updates, and set a callback to handle them.

    Event Data
    "location" a locationTable
    "error" an error message string
    "authorizationChanged" the new status string ("authorized", "denied", "restricted", "notDetermined")
    Index

    Constructors

    Properties

    distanceFilter: number

    The minimum distance in metres the device must move before a new update is delivered. Defaults to kCLDistanceFilterNone (all movements reported).

    identifier: string

    The unique identifier assigned to this watcher.

    Methods

    • Returns the most recently received location, or null if none yet.

      Returns Record<string, any> | null

      a locationTable, or null

    • Sets the callback function invoked when location events occur.

      Parameters

      • fn: (event: string, data: Record<string, any>) => void

        Called with the event name and associated data; see type documentation for event names

      Returns HSLocationWatcher

      self, for chaining