react-native-gizwits-sdk-v5 1.3.14 → 1.3.16

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.
@@ -4,6 +4,7 @@ buildscript {
4
4
  }
5
5
  ext {
6
6
  gson_version = '2.9.1'
7
+ startup_version = '1.1.1'
7
8
  kotlin_coroutine_version = '1.6.4'
8
9
  retrofit_version = '2.9.0'
9
10
  room_version = '2.5.0'
@@ -30,21 +31,21 @@ apply plugin: 'com.android.library'
30
31
  apply plugin: 'kotlin-android'
31
32
 
32
33
  android {
33
- compileSdkVersion safeExtGet('compileSdkVersion', 33)
34
+ compileSdkVersion safeExtGet('compileSdkVersion', 34)
34
35
  buildToolsVersion safeExtGet('buildToolsVersion', '33.0.0')
35
36
 
36
37
  defaultConfig {
37
- minSdkVersion safeExtGet('minSdkVersion', 21)
38
- targetSdkVersion safeExtGet('targetSdkVersion', 33)
38
+ minSdkVersion safeExtGet('minSdkVersion', 26)
39
+ targetSdkVersion safeExtGet('targetSdkVersion', 34)
39
40
  }
40
41
 
41
42
  compileOptions {
42
- sourceCompatibility JavaVersion.VERSION_17
43
- targetCompatibility JavaVersion.VERSION_17
43
+ sourceCompatibility JavaVersion.VERSION_11
44
+ targetCompatibility JavaVersion.VERSION_11
44
45
  }
45
46
 
46
47
  kotlinOptions {
47
- jvmTarget = '17'
48
+ jvmTarget = '11'
48
49
  }
49
50
  }
50
51
 
@@ -62,11 +63,15 @@ dependencies {
62
63
  implementation 'io.sentry:sentry-android:6.29.0'
63
64
  implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:$mqtt_version"
64
65
 
66
+ implementation "androidx.startup:startup-runtime:$startup_version"
67
+
68
+ implementation("io.github.gizwits:sdk:1.0.15")
69
+ implementation("io.github.gizwits:sdk-bluetooth:1.0.15")
70
+ implementation("io.github.gizwits:sdk-lan:1.0.15")
71
+ implementation("io.github.gizwits:sdk-mqtt:1.0.15")
72
+
73
+ // implementation files('libs/sdk-release.aar', 'libs/sdk-bluetooth-release.aar', 'libs/sdk-lan-release.aar', 'libs/sdk-mqtt-release.aar')
65
74
 
66
- implementation("io.github.gizwits:sdk:1.0.14")
67
- implementation("io.github.gizwits:sdk-bluetooth:1.0.14")
68
- implementation("io.github.gizwits:sdk-lan:1.0.14")
69
- implementation("io.github.gizwits:sdk-mqtt:1.0.14")
70
75
 
71
76
  implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version")
72
77
  // retrofit
@@ -82,4 +87,4 @@ dependencies {
82
87
  //ktor
83
88
  implementation "io.ktor:ktor-network:$ktor_network_version"
84
89
 
85
- }
90
+ }
@@ -1,6 +1,7 @@
1
1
  package com.gizwits.reactnativegizwitssdkv5
2
2
  import com.facebook.react.bridge.Callback
3
3
  import com.facebook.react.bridge.ReadableMap
4
+ import com.facebook.react.bridge.ReadableNativeMap
4
5
  import com.gizwits.smart.sdk.GizDevice
5
6
  import com.gizwits.smart.sdk.GizSDKManager
6
7
  import com.gizwits.smart.sdk.exception.GizException
@@ -14,9 +15,17 @@ interface DeviceParams{
14
15
  }
15
16
  class RNGizParamsChecker {
16
17
  companion object {
18
+
19
+ private fun convertReadableMapToJson(readableMap: ReadableMap): String {
20
+ val readableNativeMap = readableMap as ReadableNativeMap
21
+ val hashMap = readableNativeMap.toHashMap()
22
+ val gson = Gson()
23
+ return gson.toJson(hashMap)
24
+ }
25
+
17
26
  fun <T : Any> check(options: ReadableMap, result: Callback, paramsType: Class<T>): T? {
18
27
  val gson = Gson()
19
- val jsonString = options.toString()
28
+ val jsonString = convertReadableMapToJson(options)
20
29
  try {
21
30
  return gson.fromJson(jsonString, paramsType)
22
31
  } catch (e: JsonSyntaxException) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gizwits-sdk-v5",
3
- "version": "1.3.14",
3
+ "version": "1.3.16",
4
4
  "description": "Gizwits",
5
5
  "homepage": "https://github.com/demchenkoalex/react-native-gizwits-sdk-v5#readme",
6
6
  "main": "lib/index.js",