Transit Cards

Transit balance readers probe known public application paths and return a normalized TransitBalance.

let manager = NFCSessionManager()
defer { manager.invalidate() }
let (info, transport) = try await manager.scan()
let balance = try await CoreExtendedNFC.readTransitBalance(info: info, transport: transport)

Pass the original info and transport from NFCSessionManager.scan directly to the reader. Do not call refineCardInfo first: its probes can change the selected application. CoreExtendedNFC.scan performs that refinement automatically, so use NFCSessionManager.scan for transit reads.

FeliCa cards are selected by system code. The FeliCa common area (FE00) can hold several prepaid e-money purses: Rakuten Edy, WAON and nanaco are tried in that order, each recognized by its balance service. ISO 7816 cards are probed for CEPAS with SELECT file 4000 and GET PURSE, then for KS X 6924 and T-Union.

Detection Fallback

Card familySelectorReader
Japan ICFeliCa 0003, service 008BBalance and history
Rakuten EdyFeliCa FE00, service 1317Balance, Edy ID, issue date and history
WAONFeliCa FE00, service 6817Balance, WAON number, points and history
nanacoFeliCa FE00, service 5597Balance, nanaco number, card dates, points and history
OctopusFeliCa 8008, service 0117Balance
Singapore EZ-Link / CEPASFile 4000, purse 3Balance and recent history
Korea KS X 6924Hyundai, T-Money / Snapper, Cashbee, MOIBA, EB Card, K-Cash AIDsBalance and records where available
China T-UnionAID A000000632010105Dual-purse balance and records

Amounts and Balances

Singapore EZ-Link / CEPAS

Traditional, non-SimplyGo CEPAS cards are included in readTransitBalance and the example app’s Scan Transit Card action. Reads return the purse and recent transaction log. A single traditional EZ-Link card was read successfully on iPhone Air running iOS 27.0 (24A5355q) on 2026-09-25: the app displayed its balance and four history records. That test used the dedicated Singapore path; the integrated automatic scan has not yet been tested on a physical card. Offline operation, ticket-machine comparison, and other card variants have not been verified. SimplyGo account-based history is not supported.

The example app’s ISO 7816 AID list already contains A000000341000101 as an existing unverified candidate. The actual initial AID from the successful read has not been confirmed, so that read does not verify this candidate. Preserve the initial AID in exported Logs when testing another card.

The reader uses the standard five-byte GET PURSE encoding accepted by Core NFC and the tested card. Older cards may reject it with 6700; the historical six-byte variant is rejected by NFCISO7816APDU(data:) in the iOS Simulator. See the protocol findings.

Physical Card Verification

  1. Use one traditional EZ-Link card that has not been upgraded to SimplyGo. Photograph or record its ticket-machine balance and two known recent journeys, including their dates, times, amounts, and stations or bus routes.
  2. Run the example app on an NFC-capable iPhone. Turn off Wi-Fi and cellular data, then open Tools → Transit Balance → Scan Transit Card. Keep only that card near the phone.
  3. Compare the displayed balance and recent records with the reference. Singapore transaction times are shown in Singapore time and monetary amounts in SGD. Raw monetary values use SGD cents. Records without a recognized monetary meaning retain their raw type and payload but omit an amount. CEPAS logs do not provide a post-transaction balance, so it is omitted.
  4. Open Logs and export the existing text/JSON log bundle. It includes session outcome, initial AID when detected, and APDU traffic. Record the iPhone model, iOS version, card type, and reference journeys with the test result.
  5. Record detection failures, protocol errors, and mismatches as failures. Distinguish a successful read from a fully verified result: an offline read must match the reference balance and both known journeys before marking that comparison complete. Simulator and mock tests cannot establish physical-card support.

See Transit Card Research for provenance.