@iotize/device-com-nfc.cordova 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iotize/device-com-nfc.cordova",
|
|
3
3
|
"main": "bundles/iotize-device-com-nfc.cordova.umd.js",
|
|
4
|
-
"version": "3.10.
|
|
4
|
+
"version": "3.10.1",
|
|
5
5
|
"description": "Near Field Communication (NFC) Plugin. Read and write NDEF messages to NFC tags and share NDEF messages with peers.",
|
|
6
6
|
"cordova": {
|
|
7
7
|
"id": "@iotize/device-com-nfc.cordova",
|
package/src/ios/NFCHelpers.swift
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import CoreNFC
|
|
2
2
|
|
|
3
3
|
public extension String {
|
|
4
|
-
|
|
5
|
-
func dataFromHexString() -> Data {
|
|
4
|
+
func dataFromHexString() -> Data {
|
|
6
5
|
var bytes = [UInt8]()
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
bytes.reserveCapacity(count / 2)
|
|
7
|
+
|
|
8
|
+
var index = startIndex
|
|
9
|
+
while index < endIndex {
|
|
10
|
+
let next = self.index(index, offsetBy: 2)
|
|
11
|
+
let byteString = String(self[index..<next])
|
|
12
|
+
let byte = UInt8(byteString, radix: 16)!
|
|
13
|
+
bytes.append(byte)
|
|
14
|
+
index = next
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
|
|
17
|
+
return Data(bytes)
|
|
14
18
|
}
|
|
15
|
-
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
public extension Data {
|