Latest 0.3.0
Homepage https://github.com/jvk75/NFCNDEFParse
License MIT
Platforms ios 11.0
Authors

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. 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.

Latest podspec

{
    "name": "NFCNDEFParse",
    "version": "0.3.0",
    "summary": "NFC Forum Well Known Type Data Parser for iOS11 and Core NFC",
    "description": "NFC Forum Well Known Type Data Parser for iOS11 and Core NFC.nSupports parsing of types:nText - NFCForum-TS-RTD_Text_1.0 2006-07-24nUri - NFCForum-TS-RTD_URI_1.0 2006-07-24nSmart Poster - NFCForum-SmartPoster_RTD_1.0 2006-07-24 (title, uri, action, size)",
    "homepage": "https://github.com/jvk75/NFCNDEFParse",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jari Kalinainen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jvk75/NFCNDEFParse.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "NFCNDEFParse/*",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This