react-native-mytatva-rn-sdk 1.2.46 → 1.2.49
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/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +128 -58
- package/android/src/main/java/com/mytatvarnsdk/activity/BtManageActivity.java +345 -345
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +17 -38
- package/android/src/main/java/com/mytatvarnsdk/activity/ExitJourneyBottomSheet.kt +51 -51
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +10 -5
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +4 -5
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +4 -5
- package/android/src/main/java/com/mytatvarnsdk/activity/QRActivity.kt +96 -92
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +2 -2
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +1 -1
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +4 -2
- package/android/src/main/java/com/mytatvarnsdk/activity/VideoActivity.kt +12 -7
- package/android/src/main/java/com/mytatvarnsdk/utils/TatvaEncryptionConfig.kt +0 -5
- package/android/src/main/res/layout/activity_video.xml +13 -2
- package/ios/Database/KLTBluetoothManager.m +9 -4
- package/ios/Database/KLTDatabaseHandler.m +53 -6
- package/ios/MyReactNativeBridge.h +4 -1
- package/ios/MyReactNativeBridge.m +433 -191
- package/ios/Support/API.swift +0 -1
- package/ios/Support/Global.swift +12 -0
- package/ios/ViewControllers/AttachTransmitterViewController.swift +33 -2
- package/ios/ViewControllers/ChatWithExpertViewController.swift +33 -3
- package/ios/ViewControllers/ConnectToSensorViewController.swift +101 -12
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +121 -5
- package/ios/ViewControllers/ProvidePermissionViewController.swift +37 -5
- package/ios/ViewControllers/PutOnTheSensorViewController.swift +22 -2
- package/ios/ViewControllers/StartConnectionViewController.swift +31 -3
- package/ios/ViewModel/FinalViewModel.swift +155 -48
- package/package.json +1 -1
|
@@ -3,11 +3,6 @@ package com.mytatvarnsdk.utils
|
|
|
3
3
|
object TatvaEncryptionConfig {
|
|
4
4
|
const val STAGE_BASE_URL = "https://api-feature2.mytatva.in/api/v8"
|
|
5
5
|
const val PROD_BASE_URL = "https://api.mytatva.in/api/v8"
|
|
6
|
-
const val UAT_BASE_URL = "https://api-uat.mytatva.in"
|
|
7
|
-
|
|
8
|
-
const val GOODFLIP_PROD_SITE_URL = "https://app.goodflip.in"
|
|
9
|
-
const val GOODFLIP_DEV_SITE_URL = "https://app-uat.goodflip.in"
|
|
10
|
-
const val GOODFLIP_ACHIEVE_DEV_SITE_URL = "https://uat.goodflip.in"
|
|
11
6
|
|
|
12
7
|
const val PROD_ENC_KEY = "9Ddyaf6rfywpiTvTiax2iq6ykKpaxgJ6"
|
|
13
8
|
const val STAGE_ENC_KEY = "9Ddyaf6rfywpiTvTiax2iq6ykKpaxgJ6"
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
android:background="#E6000000"
|
|
9
9
|
tools:context=".activity.VideoActivity">
|
|
10
10
|
|
|
11
|
+
<androidx.appcompat.widget.AppCompatImageView
|
|
12
|
+
android:id="@+id/ivClose"
|
|
13
|
+
android:layout_width="40dp"
|
|
14
|
+
android:layout_height="40dp"
|
|
15
|
+
android:padding="7dp"
|
|
16
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
17
|
+
app:layout_constraintTop_toTopOf="parent"
|
|
18
|
+
app:srcCompat="@drawable/ic_close_gray" />
|
|
19
|
+
|
|
11
20
|
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
|
|
12
21
|
android:id="@+id/youtube_player_view"
|
|
13
22
|
android:layout_width="match_parent"
|
|
@@ -23,10 +32,12 @@
|
|
|
23
32
|
android:id="@+id/full_screen_view_container"
|
|
24
33
|
android:layout_width="match_parent"
|
|
25
34
|
android:layout_height="match_parent"
|
|
26
|
-
android:visibility="
|
|
35
|
+
android:visibility="visible"
|
|
27
36
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
28
37
|
app:layout_constraintEnd_toEndOf="parent"
|
|
29
38
|
app:layout_constraintStart_toStartOf="parent"
|
|
30
|
-
app:layout_constraintTop_toTopOf="parent"
|
|
39
|
+
app:layout_constraintTop_toTopOf="parent">
|
|
40
|
+
|
|
41
|
+
</FrameLayout>
|
|
31
42
|
|
|
32
43
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -363,13 +363,13 @@
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
if ([command isEqualToString:@"11"]) {
|
|
366
|
-
// CT3
|
|
366
|
+
// Reset response received from CT3/CT4
|
|
367
367
|
TransmitterReset *resetData = [ProtocalTools reset_response2:characteristic.value andEDevice:self.eDevice];
|
|
368
368
|
if (resetData.isBind) {
|
|
369
|
-
|
|
369
|
+
// Transmitter is still bound → send low-power mode command
|
|
370
370
|
[peripheral writeValue:[ProtocalTools lowPower_request:self.eDevice] forCharacteristic:self.writeReadCharacteristic type:CBCharacteristicWriteWithoutResponse];
|
|
371
371
|
} else {
|
|
372
|
-
//
|
|
372
|
+
// Transmitter is unbound (e.g., reset + power cycle)
|
|
373
373
|
self.status = BluetoothManagerStatusSensorLostPower;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -391,6 +391,10 @@
|
|
|
391
391
|
GlucoseData *glucose = [[KLTDatabaseHandler shared] addCT3GlucoseDataWithReceiveData:receiveData];
|
|
392
392
|
KLTLog(@"计算glucose.gluADC = %@, glucose.errorCode = %@", glucose.gluADC, glucose.errorCode);
|
|
393
393
|
[currentDevice addGlucoseDatasObject:glucose];
|
|
394
|
+
KLTLog(@"==============>>> GlucoseData");
|
|
395
|
+
KLTLog(@"GlucoseData Details:\n""gluADC: %@\n""glu: %@\n""errorCode: %@\n""temperature: %@\n""trend: %@\n""dataId: %@\n""operatingCurrent: %@\n""blankCurrent: %@\n""k: %@\n""iw: %@\n""calibrationStatus: %@\n""initialBeginDate: %@\n""receiveDateTime: %@\n""userBG: %@\n""device: %@",
|
|
396
|
+
glucose.gluADC,glucose.glu,glucose.errorCode,glucose.temperature,glucose.trend,glucose.dataId,glucose.operatingCurrent,glucose.blankCurrent,glucose.k,glucose.iw,glucose.calibrationStatus,glucose.initialBeginDate,glucose.receiveDateTime,glucose.userBG,glucose.device.deviceName);
|
|
397
|
+
|
|
394
398
|
if (!self.isInResend) {
|
|
395
399
|
[Notification_Center postNotificationName:@"latestGluData" object:glucose];
|
|
396
400
|
self.status = BluetoothManagerStatusGetGLU;
|
|
@@ -515,7 +519,7 @@
|
|
|
515
519
|
}
|
|
516
520
|
|
|
517
521
|
[Notification_Center postNotificationName:KLTUpdateDataNotify object:NULL];
|
|
518
|
-
|
|
522
|
+
NSLog(@"----------------------------------------------called handleResendDataWithPrefix22 for KLTUpdateDataNotify");
|
|
519
523
|
NSInteger maxGlucoseId = [KLTDatabaseHandler.shared getLatestAndMaxGlucoseIdOfDevice:self.currentDevice];
|
|
520
524
|
NSInteger remain_points = self.eDevice.endNumber - (maxGlucoseId + 1);
|
|
521
525
|
if (remain_points <= 0) {
|
|
@@ -540,6 +544,7 @@
|
|
|
540
544
|
[self handleCommonCT3GlucoseDataWithReceiveData:receive];
|
|
541
545
|
[Notification_Center postNotificationName:@"DidHandleResendDataNoReload" object:nil];
|
|
542
546
|
[Notification_Center postNotificationName:KLTUpdateDataNotify object:NULL];
|
|
547
|
+
NSLog(@"----------------------------------------------called handleReceiveDataWithPrefix07Glucose for KLTUpdateDataNotify");
|
|
543
548
|
NSInteger remain_points = [KLTDatabaseHandler.shared numberOfLifeCycleSensorWithDevice:self.currentDevice endNumber:self.eDevice.endNumber];
|
|
544
549
|
if (remain_points <= 0) {
|
|
545
550
|
[self closeBleSensor];
|
|
@@ -191,18 +191,51 @@
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
|
|
194
|
+
//- (NSArray<GlucoseData*> *)queryGlucoseDataWithDevice:(Device *)currentDevice {
|
|
195
|
+
// NSEntityDescription *entity = [NSEntityDescription entityForName:@"GlucoseData" inManagedObjectContext:self.context];
|
|
196
|
+
// NSFetchRequest *request = [[NSFetchRequest alloc] init];
|
|
197
|
+
// NSPredicate *predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@", currentDevice.identifier, currentDevice.initialBeginDate];
|
|
198
|
+
// request.entity = entity;
|
|
199
|
+
// request.predicate = predicate;
|
|
200
|
+
// NSArray *resendDatas = [self.context executeFetchRequest:request error:nil];
|
|
201
|
+
// resendDatas = [resendDatas sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"receiveDateTime" ascending:YES]]];
|
|
202
|
+
// return resendDatas;
|
|
203
|
+
//}
|
|
204
|
+
|
|
194
205
|
- (NSArray<GlucoseData*> *)queryGlucoseDataWithDevice:(Device *)currentDevice {
|
|
195
206
|
NSEntityDescription *entity = [NSEntityDescription entityForName:@"GlucoseData" inManagedObjectContext:self.context];
|
|
196
207
|
NSFetchRequest *request = [[NSFetchRequest alloc] init];
|
|
197
208
|
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@", currentDevice.identifier, currentDevice.initialBeginDate];
|
|
198
209
|
request.entity = entity;
|
|
199
210
|
request.predicate = predicate;
|
|
211
|
+
|
|
200
212
|
NSArray *resendDatas = [self.context executeFetchRequest:request error:nil];
|
|
201
213
|
resendDatas = [resendDatas sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"receiveDateTime" ascending:YES]]];
|
|
214
|
+
|
|
215
|
+
// 🖨️ Add single-line logging for each GlucoseData entry
|
|
216
|
+
NSLog(@"==== GlucoseData (Fetched %lu records) for Device: %@ ====", (unsigned long)resendDatas.count, currentDevice.identifier);
|
|
217
|
+
for (GlucoseData *g in resendDatas) {
|
|
218
|
+
NSLog(@"[ID:%@] Date:%@ | glu:%@ mmol/L | gluADC:%@ mg/dL | BG:%@ | T:%@°C | Ib:%@ | Iw:%@ | Trend:%@ | Err:%@ | CalStatus:%@",
|
|
219
|
+
g.dataId,
|
|
220
|
+
g.receiveDateTime,
|
|
221
|
+
g.glu,
|
|
222
|
+
g.gluADC,
|
|
223
|
+
g.userBG,
|
|
224
|
+
g.temperature,
|
|
225
|
+
g.blankCurrent,
|
|
226
|
+
g.operatingCurrent,
|
|
227
|
+
g.trend,
|
|
228
|
+
g.errorCode,
|
|
229
|
+
g.calibrationStatus
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
202
233
|
return resendDatas;
|
|
203
234
|
}
|
|
204
235
|
|
|
205
236
|
|
|
237
|
+
|
|
238
|
+
|
|
206
239
|
// 如果不是第一次连接发射器,更新device连接次数和连接时间
|
|
207
240
|
- (void)updateDeviceWithDeviceId:(NSString *)identify
|
|
208
241
|
scannedTime:(NSString *)scannedTime
|
|
@@ -267,24 +300,38 @@
|
|
|
267
300
|
NSLog(@"Core Data context is nil");
|
|
268
301
|
return @[];
|
|
269
302
|
}
|
|
303
|
+
|
|
270
304
|
NSEntityDescription *entity = [NSEntityDescription entityForName:@"ReceiveDataInfo" inManagedObjectContext:self.context];
|
|
305
|
+
if (!entity) {
|
|
306
|
+
NSLog(@"Entity 'ReceiveDataInfo' not found in Core Data model");
|
|
307
|
+
return @[];
|
|
308
|
+
}
|
|
309
|
+
|
|
271
310
|
NSFetchRequest *request = [[NSFetchRequest alloc] init];
|
|
311
|
+
request.entity = entity;
|
|
312
|
+
|
|
272
313
|
NSPredicate *predicate;
|
|
273
314
|
if (needUserBG) {
|
|
274
|
-
predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@
|
|
315
|
+
predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ AND gluADC > 0 AND gluADC != nil AND isDelete == nil", currentDevice.identifier, currentDevice.initialBeginDate];
|
|
275
316
|
} else {
|
|
276
|
-
predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ AND isDelete ==
|
|
317
|
+
predicate = [NSPredicate predicateWithFormat:@"device.identifier = %@ AND initialBeginDate = %@ AND isDelete == nil", currentDevice.identifier, currentDevice.initialBeginDate];
|
|
277
318
|
}
|
|
278
|
-
request.entity = entity;
|
|
279
319
|
request.predicate = predicate;
|
|
280
|
-
|
|
281
|
-
|
|
320
|
+
|
|
321
|
+
NSError *fetchError = nil;
|
|
322
|
+
NSArray *resendDatas = [self.context executeFetchRequest:request error:&fetchError];
|
|
323
|
+
|
|
324
|
+
if (fetchError) {
|
|
325
|
+
NSLog(@"❌ Fetch error: %@", fetchError.localizedDescription);
|
|
282
326
|
return @[];
|
|
283
327
|
}
|
|
284
|
-
|
|
328
|
+
|
|
285
329
|
resendDatas = [resendDatas sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"receiveDateTime" ascending:YES]]];
|
|
330
|
+
NSLog(@"📡 resendDatas: %@", resendDatas);
|
|
331
|
+
|
|
286
332
|
return resendDatas;
|
|
287
333
|
}
|
|
334
|
+
|
|
288
335
|
- (NSArray *)queryAllReceiveData {
|
|
289
336
|
NSEntityDescription *entity = [NSEntityDescription entityForName:@"ReceiveDataInfo" inManagedObjectContext:self.context];
|
|
290
337
|
NSFetchRequest *request = [[NSFetchRequest alloc] init];
|
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
#ifndef MyReactNativeBridge_h
|
|
9
9
|
#define MyReactNativeBridge_h
|
|
10
10
|
|
|
11
|
+
#import "GlucoseData+CoreDataClass.h"
|
|
12
|
+
#import "Device+CoreDataClass.h"
|
|
13
|
+
|
|
11
14
|
|
|
12
15
|
#endif /* MyReactNativeBridge_h */
|
|
13
16
|
#import "KLTAppDelegate.h"
|
|
14
17
|
#import <Foundation/Foundation.h>
|
|
15
18
|
#import <React/RCTBridgeModule.h>
|
|
16
19
|
#import <React/RCTEventEmitter.h>
|
|
17
|
-
|
|
20
|
+
#import "KLTDatabaseHandler.h"
|
|
18
21
|
@interface CgmTrackyLib : RCTEventEmitter <RCTBridgeModule>
|
|
19
22
|
|
|
20
23
|
@end
|