react-native-mytatva-rn-sdk 1.2.5 → 1.2.7
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/android/build.gradle +4 -2
- package/android/src/main/AndroidManifestNew.xml +21 -10
- package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +6 -6
- package/android/src/main/java/com/mytatvarnsdk/MainApplication.kt +4 -6
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +412 -363
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +1 -1
- package/android/src/main/res/drawable/bg_dark_blue.xml +6 -0
- package/android/src/main/res/drawable/bg_green_progress.xml +6 -0
- package/android/src/main/res/drawable/bg_grey.xml +6 -0
- package/android/src/main/res/layout/activity_connect_sensor.xml +98 -1
- package/android/src/main/res/layout/activity_permission.xml +106 -8
- package/android/src/main/res/layout/activity_place_sensor.xml +98 -1
- package/android/src/main/res/layout/activity_place_transmitter.xml +98 -1
- package/android/src/main/res/layout/activity_search_transmitter.xml +99 -4
- package/android/src/main/res/layout/activity_sensor_connect_success.xml +98 -1
- package/android/src/main/res/values/strings.xml +1 -0
- package/android/src/main/res/values/styles.xml +71 -58
- package/ios/MyReactNativeBridge.h +4 -1
- package/ios/MyReactNativeBridge.m +124 -2
- package/ios/Support/API.swift +3 -1
- package/ios/ViewControllers/AttachTransmitterViewController.swift +3 -1
- package/ios/ViewControllers/ConnectToSensorViewController.swift +21 -10
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +24 -1
- package/ios/ViewControllers/ProvidePermissionViewController.swift +12 -0
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -179,8 +179,10 @@ dependencies {
|
|
|
179
179
|
implementation "io.ktor:ktor-client-serialization:$ktor_version"
|
|
180
180
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
|
|
181
181
|
|
|
182
|
-
implementation
|
|
183
|
-
implementation
|
|
182
|
+
implementation(name: 'library_zxing-release', ext: 'aar')
|
|
183
|
+
implementation(name: 'algorithm-release', ext: 'aar')
|
|
184
|
+
//implementation files('libs/library_zxing-release.aar')
|
|
185
|
+
//implementation files('libs/algorithm-release.aar')
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
if (isNewArchitectureEnabled()) {
|
|
@@ -76,41 +76,52 @@
|
|
|
76
76
|
|
|
77
77
|
<activity
|
|
78
78
|
android:name=".activity.PermissionActivity"
|
|
79
|
-
android:exported="false"
|
|
79
|
+
android:exported="false"
|
|
80
|
+
android:theme="@style/MyTheme" />
|
|
80
81
|
|
|
81
82
|
<activity
|
|
82
83
|
android:name=".activity.StartCGMActivity"
|
|
83
|
-
android:exported="false"
|
|
84
|
+
android:exported="false"
|
|
85
|
+
android:theme="@style/MyTheme" />
|
|
84
86
|
|
|
85
|
-
<activity
|
|
87
|
+
<activity
|
|
88
|
+
android:name=".MainActivity"
|
|
89
|
+
android:theme="@style/MyTheme" />
|
|
86
90
|
|
|
87
91
|
<activity
|
|
88
92
|
android:name=".activity.SearchTransmitterActivity"
|
|
89
|
-
android:exported="false"
|
|
93
|
+
android:exported="false"
|
|
94
|
+
android:theme="@style/MyTheme" />
|
|
90
95
|
|
|
91
96
|
<activity
|
|
92
97
|
android:name=".activity.QRActivity"
|
|
93
|
-
android:exported="false"
|
|
98
|
+
android:exported="false"
|
|
99
|
+
android:theme="@style/MyTheme" />
|
|
94
100
|
|
|
95
101
|
<activity
|
|
96
102
|
android:name=".activity.PlaceSensorActivity"
|
|
97
|
-
android:exported="false"
|
|
103
|
+
android:exported="false"
|
|
104
|
+
android:theme="@style/MyTheme" />
|
|
98
105
|
|
|
99
106
|
<activity
|
|
100
107
|
android:name=".activity.SensorConnectSuccessActivity"
|
|
101
|
-
android:exported="false"
|
|
108
|
+
android:exported="false"
|
|
109
|
+
android:theme="@style/MyTheme" />
|
|
102
110
|
|
|
103
111
|
<activity
|
|
104
112
|
android:name=".activity.PlaceTransmitterActivity"
|
|
105
|
-
android:exported="false"
|
|
113
|
+
android:exported="false"
|
|
114
|
+
android:theme="@style/MyTheme" />
|
|
106
115
|
|
|
107
116
|
<activity
|
|
108
117
|
android:name=".activity.HelpActivity"
|
|
109
|
-
android:exported="false"
|
|
118
|
+
android:exported="false"
|
|
119
|
+
android:theme="@style/MyTheme" />
|
|
110
120
|
|
|
111
121
|
<activity
|
|
112
122
|
android:name=".activity.ConnectSensorActivity"
|
|
113
|
-
android:exported="false"
|
|
123
|
+
android:exported="false"
|
|
124
|
+
android:theme="@style/MyTheme" />
|
|
114
125
|
|
|
115
126
|
<receiver
|
|
116
127
|
android:name=".receiver.BootCompleteReceiver"
|
|
@@ -117,7 +117,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
117
117
|
val bluetoothAdapter: BluetoothAdapter? = BluetoothAdapter.getDefaultAdapter()
|
|
118
118
|
var bleStatus = bluetoothAdapter?.isEnabled == true
|
|
119
119
|
var status = ""
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
if (mStatus.isEmpty()) {
|
|
122
122
|
if (device.isBoundAndConnect) {
|
|
123
123
|
status = DeviceStatus.CONNECTED.id
|
|
@@ -135,19 +135,19 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
135
135
|
} else {
|
|
136
136
|
status = mStatus
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
|
|
139
139
|
if (status.isNotEmpty()) {
|
|
140
140
|
val rawData = JSONObject()
|
|
141
141
|
rawData.put("transmitterName", device.name)
|
|
142
142
|
rawData.put("SensorId", device.qrMessage)
|
|
143
143
|
rawData.put("Sensor", device.qrMessage)
|
|
144
144
|
rawData.put("timeInMillis", Date().time)
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
val obj = JSONObject()
|
|
147
147
|
obj.put("sensorId", device.qrMessage)
|
|
148
148
|
obj.put("status", status)
|
|
149
149
|
obj.put("rawData", rawData)
|
|
150
|
-
|
|
150
|
+
|
|
151
151
|
authenticateSDKService.postDeviceData(
|
|
152
152
|
environment = if ("uat".uppercase() == "PROD") TATVA_ENVIRONMENT.PROD else TATVA_ENVIRONMENT.STAGE,
|
|
153
153
|
data = obj.toString(),
|
|
@@ -155,13 +155,13 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
155
155
|
loaderListener = object : LoaderListener {
|
|
156
156
|
override fun onShowLoader() {
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
override fun onHideLoader() {
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
} catch (e: Exception) {
|
|
166
166
|
e.printStackTrace()
|
|
167
167
|
}
|
|
@@ -14,10 +14,6 @@ import com.facebook.soloader.SoLoader
|
|
|
14
14
|
|
|
15
15
|
class MainApplication : BApplication(), ReactApplication {
|
|
16
16
|
|
|
17
|
-
companion object {
|
|
18
|
-
// Removed lateinit var mainApp and getAppContext()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
17
|
override fun attachBaseContext(base: Context?) {
|
|
22
18
|
super.attachBaseContext(base)
|
|
23
19
|
MultiDex.install(base)
|
|
@@ -39,8 +35,10 @@ class MainApplication : BApplication(), ReactApplication {
|
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
// ✅ FIXED: method instead of property
|
|
39
|
+
override fun getReactNativeHost(): ReactNativeHost {
|
|
40
|
+
return mReactNativeHost
|
|
41
|
+
}
|
|
44
42
|
|
|
45
43
|
override fun onCreate() {
|
|
46
44
|
super.onCreate()
|