@iotize/device-com-nfc.cordova 3.10.0 → 4.0.0

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.0",
4
+ "version": "4.0.0",
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/plugin.xml CHANGED
@@ -12,6 +12,8 @@
12
12
  <issue>https://github.com/iotize-sas/device-com-nfc.cordova/issues</issue>
13
13
 
14
14
  <platform name="android">
15
+ <dependency id="@iotize/device-com-android-shared.cordova" version="0.0.3"/>
16
+
15
17
  <js-module src="www/phonegap-nfc.js" name="NFC">
16
18
  <runs />
17
19
  </js-module>
@@ -39,6 +41,8 @@
39
41
  <source-file src="src/android/src/com/chariotsolutions/nfc/plugin/NFC4Protocol.java" target-dir="src/com/chariotsolutions/nfc/plugin"/>
40
42
  <source-file src="src/android/src/com/chariotsolutions/nfc/plugin/NFC5Protocol.java" target-dir="src/com/chariotsolutions/nfc/plugin"/>
41
43
 
44
+ <source-file src="src/android/libs/iotize-device-com-nfc-1.0.0-alpha.9.aar" target-dir="libs"/>
45
+
42
46
  <config-file target="AndroidManifest.xml" parent="/manifest">
43
47
  <uses-permission android:name="android.permission.NFC"/>
44
48
  <uses-feature android:name="android.hardware.nfc" android:required="false"/>
@@ -3,14 +3,6 @@ repositories{
3
3
  flatDir {
4
4
  dirs 'libs'
5
5
  }
6
- maven {
7
- // Add iotize repository url
8
- url "http://repo.iotize.com/artifactory/gradle-release"
9
- allowInsecureProtocol = true
10
- content {
11
- includeGroupByRegex "com\\.iotize\\.android"
12
- }
13
- }
14
6
  }
15
7
 
16
8
  dependencies {
@@ -18,20 +10,11 @@ dependencies {
18
10
  implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.61"
19
11
  implementation 'org.apache.commons:commons-collections4:4.4'
20
12
 
21
- // Add core library
22
- implementation 'com.iotize.android:iotize-core:1.0.0-alpha.9'
23
-
24
- // api
25
- implementation 'com.iotize.android:iotize-device-api:1.0.0-alpha.9'
26
- implementation 'com.iotize.android:iotize-client:1.0.0-alpha.9'
27
- implementation 'com.iotize.android:iotize-device:1.0.0-alpha.9'
28
-
29
- // NFC
30
- implementation 'com.iotize.android:iotize-device-com-nfc:1.0.0-alpha.9'
31
-
32
13
  // RX
33
14
  implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
34
15
 
16
+ implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
17
+
35
18
  }
36
19
 
37
20
  android {
@@ -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
- for i in 0..<(count/2) {
8
- let range = index(self.startIndex, offsetBy: 2*i)..<index(self.startIndex, offsetBy: 2*i+2)
9
- let stringBytes = self[range]
10
- let byte = strtol((stringBytes as NSString).utf8String, nil, 16)
11
- bytes.append(UInt8(byte))
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
- return Data(bytes: UnsafePointer<UInt8>(bytes), count:bytes.count)
16
+
17
+ return Data(bytes)
14
18
  }
15
-
16
19
  }
17
20
 
18
21
  public extension Data {
@@ -4,4 +4,4 @@
4
4
  //
5
5
  // (c) 2018 IoTize Solutions
6
6
 
7
- #import "../../../AppDelegate.h"
7
+ #import "../../../Classes/AppDelegate.h"