Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ See [docs/adr-nfc-library.md](docs/adr-nfc-library.md) for platform constraints
- [Product flows & system definition](docs/ding-payments.md)
- [Client MVP build plan](docs/build-plan-client-mvp.md)
- [NFC library ADR](docs/adr-nfc-library.md)
- [NFC runtime flow and troubleshooting](docs/nfc-flow.md)
- [NFC device checklist](docs/nfc-device-checklist.md)

## License

Expand Down
11 changes: 11 additions & 0 deletions docs/nfc-device-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NFC device checklist

Devices to test
- iPhone with Core NFC support (physical device)
- Pixel-class Android device
- Samsung/other OEM device to capture vendor variance

Checklist
- Ensure NFC is enabled in system settings.
- For iOS: confirm entitlement and Info.plist usage string present in `app.config.ts`.
- For Android: confirm `android.permission.NFC` is declared and app handles foreground dispatch.
27 changes: 27 additions & 0 deletions docs/nfc-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# NFC flow and troubleshooting

This document describes the NFC handshake, security constraints, and common troubleshooting steps for developers and beta testers.

Overview
- Roles: Writer (sender) and Reader (receiver).
- Format: `payment-request.v1` JSON payload with non-sensitive fields only.

Handshake
1. Writer prepares `payment-request.v1` payload with `id` and optional `expiresAt` (epoch seconds).
2. Reader calls `useNfc().startReading()` and waits for inbound payload.
3. On read, the app validates payload using `validatePaymentRequest()` which enforces expiry and replay dedupe.
4. If valid, proceed to presentation/confirm UI. If invalid, surface mapped Spanish error copy.

Security rules
- Forbidden fields: secret, private, seed, token, passphrase, password, privKey, keyPair.
- Replay protection: 5-minute TTL dedupe window; duplicate requests rejected deterministically.
- Clock skew tolerance: 30s default; configurable in validator.

Platform notes
- iOS: Core NFC requires entitlement `com.apple.developer.nfc.readersession.formats` and `NFCReaderUsageDescription` in Info.plist. Only physical devices supported.
- Android: Add `android.permission.NFC` and handle foreground dispatch. Test on Pixel and Samsung-class devices.

Troubleshooting
- NFC Unavailable: ensure device supports NFC and app has permissions.
- NFC Disabled: ask user to enable in OS settings.
- Timeout: ask users to bring devices closer and retry.
Loading
Loading