Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jvk75/NFCNDEFParse
NFC Forum Well Known Type Data Parser for iOS11 and Core NFC
https://github.com/jvk75/NFCNDEFParse
cocoapods corenfc data-parser ios ios11 ndef ndef-format nfc nfc-forum nfc-reader objective-c swift uri
Last synced: 8 days ago
JSON representation
NFC Forum Well Known Type Data Parser for iOS11 and Core NFC
- Host: GitHub
- URL: https://github.com/jvk75/NFCNDEFParse
- Owner: jvk75
- License: mit
- Created: 2017-10-09T19:55:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-15T10:38:23.000Z (about 7 years ago)
- Last Synced: 2024-11-24T03:31:49.189Z (18 days ago)
- Topics: cocoapods, corenfc, data-parser, ios, ios11, ndef, ndef-format, nfc, nfc-forum, nfc-reader, objective-c, swift, uri
- Language: Swift
- Size: 61.5 KB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - NFCNDEFParse - NFC Forum Well Known Type Data Parser for iOS11 and Core NFC. (Hardware / Other Hardware)
- awesome-ios-star - NFCNDEFParse - NFC Forum Well Known Type Data Parser for iOS11 and Core NFC. (Hardware / Other Hardware)
README
# NFCNDEFParse
NFC Forum Well Known Type Data Parser for iOS11 and Core NFC.
Supports parsing of types:
Text - NFCForum-TS-RTD_Text_1.0 2006-07-24
Uri - NFCForum-TS-RTD_URI_1.0 2006-07-24
Smart Poster - NFCForum-SmartPoster_RTD_1.0 2006-07-24 (title, uri, action, size)
## Requirements
Core NFC requires iOS11 (and Xcode 9)
## Installation
NFCNDEFParse is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```
pod 'NFCNDEFParse'
```## Usage
**Note: For non CocoaPods usage and more details see Examples!**
### Import the library.
Swift:
```
import NFCNDEFParse
```Objective-C:
```
@import NFCNDEFParse;
```### Create array for the messages
```
var data: [NDEFMessageWithWellKnownTypes] = []
```### In CoreNFC callback create the "well know types" data array.
```
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
data = messages.flatMap({ NDEFMessageWithWellKnownTypes(records: $0.records) })
}
```### Loop through the data array to print out the values.
```
data.forEach({ message in
print("message: ")
message.records.forEach({ record in
print(record.description)
})
})```
## Author
Jari Kalinainen, [email protected]
## License
NFCNDEFParse is available under the MIT license. See the LICENSE file for more info.