Skip to content

PAM Native NFC

Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-app --template native
cd my-app
pam composer require pushinbr/pam-native-nfc
pam doctor
pam native dev
$nfc->beginRead(fn (bool $ok, ?string $error) => null);
$nfc->write(NdefRecord::uri('https://pam.dev'), fn (bool $ok, ?string $error) => null);
$nfc->poll(fn (array $events) => handleNfcEvents($events));

Nfc begins/ends sessions, writes, and polls; NdefRecord builds URI, text, MIME, and external records; NfcEvent/NfcEventKind type events; NfcAvailability reports support.

Only one session may run. The queue holds 128 events and PHP NDEF payloads stop at 1 MiB; physical tag capacity is checked on write. iOS requires capability and signed compatible hardware; Android requires a foreground Activity. End sessions when their screen leaves foreground and treat all tag data as untrusted.

NfcPluginProvider registers the native session module.