Skip to content

Location

Raxos\Wallet\Apple\Component\Location describes a geofence that surfaces a Pass on the lock screen when the device is near a coordinate.

php
final readonly class Location implements ComponentInterface

Implements Raxos\Contract\Wallet\ComponentInterface (see raxos/contract).

Constructor

ParameterTypeDescription
latitudefloatLatitude of the location, in degrees.
longitudefloatLongitude of the location, in degrees.
altitudefloat|nullAltitude of the location, in meters.
relevantTextstring|nullText shown on the lock screen when the pass is relevant.

Methods

jsonSerialize(): array

Returns the location data, filtering out null and empty values.

Example

php
<?php
declare(strict_types=1);

use Raxos\Wallet\Apple\Component\Location;

$location = new Location(
    latitude: 52.379189,
    longitude: 4.899431,
    relevantText: 'Welcome to the venue.'
);

See also