Skip to content

Beacon

Raxos\Wallet\Apple\Component\Beacon describes an iBeacon proximity trigger that surfaces a Pass when the device is near the beacon.

php
final readonly class Beacon implements ComponentInterface

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

Constructor

ParameterTypeDescription
proximityUUIDstringThe unique identifier of the beacon.
majorint|nullMajor value of the beacon, unsigned 16 bit.
minorint|nullMinor value of the beacon, unsigned 16 bit.
relevantTextstring|nullText shown on the lock screen when the pass is relevant.

Methods

jsonSerialize(): array

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

Example

php
<?php
declare(strict_types=1);

use Raxos\Wallet\Apple\Component\Beacon;

$beacon = new Beacon(
    proximityUUID: 'e2c56db5-dffb-48d2-b060-d0f5a71096e0',
    major: 1,
    minor: 42
);

See also