Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/karibash/rxcorenfc

RxSwift wrapper around the CoreNFC.
https://github.com/karibash/rxcorenfc

corenfc felica functional ios nfc observer reactive reactivex rxswift swift undirectional

Last synced: about 2 months ago
JSON representation

RxSwift wrapper around the CoreNFC.

Awesome Lists containing this project

README

        

# RxCoreNFC

[![Swift](https://img.shields.io/badge/Swift-5.x-orange?style=flat&logo=swift)](https://developer.apple.com/swift/)
[![Release](https://img.shields.io/github/v/release/Karibash/RxCoreNFC?style=flat&include_prereleases&logo=github)](https://github.com/Karibash/RxCoreNFC/releases)
[![Build](https://img.shields.io/github/workflow/status/Karibash/RxCoreNFC/CI?style=flat&logo=github%20actions)](https://github.com/Karibash/RxCoreNFC/actions)
[![CocoaPods](https://img.shields.io/cocoapods/v/RxCoreNFC?style=flat&logo=cocoapods)](https://github.com/Karibash/RxCoreNFC#cocoapods)
[![Carthage](https://img.shields.io/badge/Carthage-compatible-brightgreen?style=flat)](https://github.com/Karibash/RxCoreNFC#carthage)
[![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-orange?style=flat)](https://github.com/Karibash/RxCoreNFC#swift-package-manager)
[![Platform](https://img.shields.io/cocoapods/p/RxCoreNFC?style=flat&logo=apple)](http://cocoapods.org/pods/RxCoreNFC)
[![License](https://img.shields.io/github/license/Karibash/RxCoreNFC?style=flat)](https://github.com/Karibash/RxCoreNFC/blob/master/LICENSE)

[![Github](https://img.shields.io/github/followers/Karibash?label=Follow&logo=github&style=social)](https://github.com/Karibash?tab=followers)
[![Twitter](https://img.shields.io/twitter/follow/Karibash?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=Karibash)

## 🔧 Features

- [ ] NFCTagReaderSession
- [x] NFCFeliCaTag
- [x] NFCMiFareTag
- [x] NFCISO7816Tag
- [ ] NFCISO15693Tag
- [ ] NFCNDEFReaderSession
- [ ] NFCVASReaderSession

## ✔️ Requirements

- iOS 11.0+
- Xcode 9.0+
- Swift 5.0+

## 👏 Getting Started

The basic usage is as follows:

```swift
let sessions = NFCTagReaderSession.rx.open(pollingOption: [.iso18092])
let tags = sessions.begin().tags().felicaTags()
let connectedTags = Observable.combineLatest(tags, sessions)
.flatMap { tag, session in session.connect(tag) }
.share()

let invalidates = connectedTags
.requestService(nodeCodeList: SERVICE_CODE_LIST)
.withLatestFrom(connectedTags)
.readWithoutEncryption(serviceCodeList: SERVICE_CODE_LIST, blockList: BLOCK_LIST })
.do(onNext: { result in
// Do something
})
.withLatestFrom(sessions)
.invalidate()
.first()

button.rx.tap
.flatMapFirst { invalidates }
.subscribe()
.disposed(by: disposeBag)
```

## 🚀 Installation

### CocoaPods

You can use [CocoaPods](http://cocoapods.org/) to install `RxCoreNFC` by adding it to your `Podfile`:

```ruby
pod 'RxCoreNFC'
```

```
$ pod install
```

### Carthage

Create a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos) to add `$(SRCROOT)/Carthage/Build/iOS/RxCoreNFC.framework` to an iOS project.

```
github "Karibash/RxCoreNFC"
```

```
$ carthage update
```

### Swift Package Manager

File > Swift Package > Add Package Dependency... > Enter package repository URL

```
https://github.com/Karibash/RxCoreNFC
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/Karibash/RxCoreNFC/issues) if you want to contribute.

## 📝 License

Copyright © 2020 [@Karibash](https://twitter.com/karibash).

This project is [```MIT```](https://github.com/Karibash/RxCoreNFC/blob/master/LICENSE) licensed.