All Projects → tattn → NFCReader

tattn / NFCReader

Licence: MIT license
Scan and decode NFC tags on iOS

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to NFCReader

NFCReaderWriter
NFCReaderWriter which supports to read data from NFC chips(iOS 11), write data to NFC chips(iOS 13) and read NFC tags infos(iOS 13) by iOS devices. Compatible with both Swift and Objective-C. I will appreciate you if give me a star on the top right of page.
Stars: ✭ 58 (-31.76%)
Mutual labels:  nfc, felica
android-hce-desfire
A HCE software implementation of the NXP Desfire NFC protocol in an Android app (to be used with Cyanogenmod HCE patch)
Stars: ✭ 30 (-64.71%)
Mutual labels:  nfc
Chameleonmini Rebooted
Chameleon Mini revE rebooted - Iceman Fork, the ChameleonMini is a versatile contactless smartcard emulator (NFC/RFID)
Stars: ✭ 208 (+144.71%)
Mutual labels:  nfc
nfc-tags
No description or website provided.
Stars: ✭ 15 (-82.35%)
Mutual labels:  nfc
Metrodroid
Read data from public transit cards using your NFC Android phone! (iOS 13 and PC/SC support coming soon)
Stars: ✭ 238 (+180%)
Mutual labels:  nfc
react-native-nfc-manager
React Native NFC module for Android & iOS
Stars: ✭ 1,053 (+1138.82%)
Mutual labels:  nfc
Yubioath Android
Yubico Authenticator for Android
Stars: ✭ 176 (+107.06%)
Mutual labels:  nfc
flutter nfc kit
Flutter plugin to provide NFC functionality on Android and iOS, including reading metadata, read & write NDEF records, and transceive layer 3 & 4 data with NFC tags / cards
Stars: ✭ 119 (+40%)
Mutual labels:  nfc
Open-Home-Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 905 (+964.71%)
Mutual labels:  nfc
android-hostcardemulation-sample
Android HostCardEmulation sample that implements NFC Forum Type 4 Tag Operation
Stars: ✭ 47 (-44.71%)
Mutual labels:  nfc
core
UBIC: The crypto currency providing UBI for the masses using the E-Passport
Stars: ✭ 37 (-56.47%)
Mutual labels:  nfc
Flutter Nfc Reader
Flutter NFC reader plugin for iOS and Android
Stars: ✭ 240 (+182.35%)
Mutual labels:  nfc
easypay
NFC smart cards and payment terminals in Nigeria
Stars: ✭ 41 (-51.76%)
Mutual labels:  nfc
Wwdc
You don't have the time to watch all the WWDC session videos yourself? No problem me and many contributors extracted the gist for you 🥳
Stars: ✭ 2,561 (+2912.94%)
Mutual labels:  nfc
nfsee
Read your Transit/Bank/ID cards on Android/iOS phone with NFSee App
Stars: ✭ 80 (-5.88%)
Mutual labels:  nfc
Mifareclassictool
An Android NFC app for reading, writing, analyzing, etc. MIFARE Classic RFID tags.
Stars: ✭ 2,698 (+3074.12%)
Mutual labels:  nfc
Libfreefare
A convenience API for NFC cards manipulations on top of libnfc.
Stars: ✭ 252 (+196.47%)
Mutual labels:  nfc
tripreader-data
“读卡识途”项目公开数据
Stars: ✭ 58 (-31.76%)
Mutual labels:  nfc
TonUINO
Alternative TonUINO Firmware
Stars: ✭ 112 (+31.76%)
Mutual labels:  nfc
NFCSupport
Support library for NFC NDEF Records
Stars: ✭ 20 (-76.47%)
Mutual labels:  nfc

NFCReader

Scan and decode NFC tags on iOS

Features

  • Scan NFC Tag (see below about supported tags)
  • Scan custom NFC tags

Supported Tags

  • IC cards for transit in Japan
    • Suica, Pasmo, Kitaca, ICOCA, TOICA, manaca, PiTaPa, nimoca, SUGOCA, はやかけん
  • IC cards for shopping in Japan
    • nanaco
    • Edy
    • WAON

Requirements

  • Xcode 11.x
  • Swift 5.1+
  • iOS 13.0+
  • iPhone 7 and later

Installation

Swift Package Manager (Recommended)

You can install this framework with Swift Package Manager in Xcode 11.

Carthage

github "tattn/NFCReader"

Configuration

NFCReader uses Core NFC, so you need to add the following setting:

  1. Add Near Field Communication Tag Reading to Capabilities.
  2. Add Privacy - NFC Scan Usage Description to Info.plist.
  3. Add system codes of the card you want to scan to Info.plist.
Card System code
Transit cards in Japan 0003
nanaco, Edy, WAON FE00

Usage

Read histories

import NFCReader

let reader = Reader<Suica>() // `Nanaco`, `Edy` or `Waon`
reader.read(didBecomeActive: { _ in
    print("didBecomeActive")
}, didDetect: { reader, result in
    switch result {
    case .success(let suica):
        let balance = suica.boardingHistory.first?.balance ?? 0
        reader.setMessage("Your balance is ¥\(balance) .")
    case .failure(let error):
        reader.setMessage("something wrong")
    }
})

You can see more details at Sources/NFCReader/Tags:

Scan multiple tags

let reader = Reader<FeliCa>
reader.read(didDetect: { reader, result in
    switch result {
    case .success(let tag):
        switch tag {
        case .edy(let edy):
            print(edy)
        case .nanaco(let nanaco):
            print(nanaco)
        case .waon(let waon):
            print(waon)
        case .suica(let suica):
            print(suica)
        }
    case .failure(let error):
        print(error)
    }
})

The reader can also read just specific tags. Please see Sources/NFCReader/Tags/FeliCa/FeliCa.swift.

Scan tags repeatedly

reader.read(didDetect: { reader, result in
    switch result {
    case .success(let suica):
        let balance = suica.boardingHistory.first?.balance ?? 0
        reader.setMessage("Your balance is ¥\(balance) .")
        reader.restartReading() // continue to scan
    case .failure(let error):
        reader.setMessage("something wrong")
        reader.restartReading()
    }
})

Custom message

var configuration = ReaderConfiguration()
configuration.message.alert = "Hold your iPhone near the Suica."

let reader = Reader<Suica>(configuration: configuration)

Read custom tags

Please see ./Sources/NFCReader/Tags/FeliCa/nanaco/Nanaco.swift.

ToDo

  • Decode entrance and exit histories of Suica. (service code: 108F)
  • Decode SF entrance histories of Suica. (service code: 10CB)
  • Support more NFC tags.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Support this project

Donating to help me continue working on this project.

Donate

License

NFCReader is released under the MIT license. See LICENSE for details.

Author

Tatsuya Tanaka

Twitter GitHub

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].