SkateSpots/packages/skatespots-nfc
SkateSpots 8dcb19eba6 fix(nfc): add androidx.appcompat to the plugin classpath (Capacitor activity)
The APK build failed compiling the plugin: Capacitor's `activity` is an
AppCompatActivity, so the module needs appcompat. Now `npm run android:build`
succeeds, wires skatespots-nfc in, and merges the NFC permission. Still needs a
device test for the actual write.
2026-10-02 14:24:44 +07:00
..
android fix(nfc): add androidx.appcompat to the plugin classpath (Capacitor activity) 2026-10-02 14:24:44 +07:00
src feat(nfc): native Android tag-writer plugin (APK) + Web NFC on web 2026-10-02 14:14:31 +07:00
package.json feat(nfc): native Android tag-writer plugin (APK) + Web NFC on web 2026-10-02 14:14:31 +07:00
README.md feat(nfc): native Android tag-writer plugin (APK) + Web NFC on web 2026-10-02 14:14:31 +07:00

skatespots-nfc (local Capacitor Android plugin)

Writes the card/pass verify URL to an NFC tag from inside the SkateSpots APK.

Why a plugin? Web NFC (NDEFReader) is not exposed inside Capacitor's WebView, so the browser path in src/lib/nfc.ts can't run in the APK. On the web (Chrome/Android) the app uses Web NFC; in the APK it uses this plugin.

What it writes: only a single NDEF URL record — the same pointer the QR carries. A tag is passive and can be cloned like a QR; trust comes from the relay signature, verified at /#/verify/<naddr>.

Wiring

  • package.json has "skatespots-nfc": "file:packages/skatespots-nfc" so npx cap sync android adds the module.
  • The app registers the plugin by name (registerPlugin('SkateSpotsNfc')); it does not import this package into the web bundle.
  • Permissions (NFC, optional uses-feature) merge from the plugin manifest.

API

isSupported(): { supported } · writeUrl({ url }) · cancel()

⚠️ Unverified

Needs npm run android:sync + a real device. Android-only (iOS sandboxes NFC writing). The Kotlin uses NfcAdapter.enableReaderMode; tune per the app's Capacitor version if Gradle complains.