react-native-mytatva-rn-sdk 1.2.4 → 1.2.5
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/app/build.gradle +6 -0
- package/android/build.gradle +85 -5
- package/android/gradle.properties +1 -1
- package/android/libs/algorithm-release.aar +0 -0
- package/android/libs/library_zxing-release.aar +0 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +40 -2
- package/android/src/main/AndroidManifestNew.xml +127 -57
- package/android/src/main/java/cgmblelib/Enum/enumDevice.java +48 -0
- package/android/src/main/java/cgmblelib/Enum/enumError.java +102 -0
- package/android/src/main/java/cgmblelib/Enum/enumGlucoseStatus.java +99 -0
- package/android/src/main/java/cgmblelib/Enum/enumSound.java +54 -0
- package/android/src/main/java/cgmblelib/Enum/enumTrend.java +104 -0
- package/android/src/main/java/cgmblelib/Enum/enumUUID.java +134 -0
- package/android/src/main/java/cgmblelib/Enum/enumUnBind.java +52 -0
- package/android/src/main/java/cgmblelib/base/BApplication.java +86 -0
- package/android/src/main/java/cgmblelib/base/BSharedPreferences.java +110 -0
- package/android/src/main/java/cgmblelib/base/CActivity.java +128 -0
- package/android/src/main/java/cgmblelib/ble/BleService.java +231 -0
- package/android/src/main/java/cgmblelib/ble/entity/AlgorithmCallBack.java +67 -0
- package/android/src/main/java/cgmblelib/ble/gattcallback/BleGattCallback.java +410 -0
- package/android/src/main/java/cgmblelib/ble/gattcallback/EnumSynchronous.java +29 -0
- package/android/src/main/java/cgmblelib/ble/gattcallback/GattTool.java +359 -0
- package/android/src/main/java/cgmblelib/ble/gattcallback/LineUpTaskGlucoseProcess.java +168 -0
- package/android/src/main/java/cgmblelib/ble/gattcallback/ManageGattCallback.java +936 -0
- package/android/src/main/java/cgmblelib/ble/reconnectManagament/BaseReconnect.java +35 -0
- package/android/src/main/java/cgmblelib/ble/reconnectManagament/ReconnectManagement.java +298 -0
- package/android/src/main/java/cgmblelib/ble/scancallback/BleScanCallback.java +118 -0
- package/android/src/main/java/cgmblelib/ble/scancallback/ManageScanCallback.java +316 -0
- package/android/src/main/java/cgmblelib/custom/livedata/ManagementLiveData.java +216 -0
- package/android/src/main/java/cgmblelib/custom/livedata/connect/EnumConnect.java +30 -0
- package/android/src/main/java/cgmblelib/custom/livedata/connect/OperationConnectBean.java +51 -0
- package/android/src/main/java/cgmblelib/custom/livedata/connect/OperationConnectLiveData.java +66 -0
- package/android/src/main/java/cgmblelib/custom/livedata/scan/EnumScan.java +25 -0
- package/android/src/main/java/cgmblelib/custom/livedata/scan/OperationScanBean.java +60 -0
- package/android/src/main/java/cgmblelib/custom/livedata/scan/OperationScanLiveData.java +69 -0
- package/android/src/main/java/cgmblelib/custom/livedata/scan/PocDeviceAndRssi.java +57 -0
- package/android/src/main/java/cgmblelib/database/AppDatabase.java +82 -0
- package/android/src/main/java/cgmblelib/database/ArrayConverter.java +37 -0
- package/android/src/main/java/cgmblelib/database/ByteConverter.java +95 -0
- package/android/src/main/java/cgmblelib/database/DateConverter.java +40 -0
- package/android/src/main/java/cgmblelib/database/EnumConverter.java +76 -0
- package/android/src/main/java/cgmblelib/database/dao/DaoDevice.java +135 -0
- package/android/src/main/java/cgmblelib/database/dao/DaoGlucose.java +355 -0
- package/android/src/main/java/cgmblelib/database/entity/PocDevice.java +335 -0
- package/android/src/main/java/cgmblelib/database/entity/PocGlucose.java +393 -0
- package/android/src/main/java/cgmblelib/database/livedata/LatestDeviceLiveData.java +62 -0
- package/android/src/main/java/cgmblelib/database/repository/RepositoryDevice.java +206 -0
- package/android/src/main/java/cgmblelib/database/repository/RepositoryGlucose.java +195 -0
- package/android/src/main/java/cgmblelib/database/source/SourceBase.java +10 -0
- package/android/src/main/java/cgmblelib/database/source/SourceDevice.java +116 -0
- package/android/src/main/java/cgmblelib/database/source/SourceGlucose.java +232 -0
- package/android/src/main/java/cgmblelib/database/source/db/DBDataSource.java +29 -0
- package/android/src/main/java/cgmblelib/database/source/db/DeviceDBDataSource.java +194 -0
- package/android/src/main/java/cgmblelib/database/source/db/GlucoseDBDataSource.java +323 -0
- package/android/src/main/java/cgmblelib/qr/QRInformation.java +96 -0
- package/android/src/main/java/cgmblelib/receiver/BleServiceReceiver.java +129 -0
- package/android/src/main/java/cgmblelib/utils/AppExecutors.java +76 -0
- package/android/src/main/java/cgmblelib/utils/AxisYForGlucoseLevel.java +67 -0
- package/android/src/main/java/cgmblelib/utils/ConstantsLibrary.java +88 -0
- package/android/src/main/java/cgmblelib/utils/CrashHandler.java +39 -0
- package/android/src/main/java/cgmblelib/utils/DiskIOThreadExecutor.java +23 -0
- package/android/src/main/java/cgmblelib/utils/MyLog.java +606 -0
- package/android/src/main/java/cgmblelib/utils/NotificationTool.java +115 -0
- package/android/src/main/java/cgmblelib/utils/PermissionCheckTool.java +47 -0
- package/android/src/main/java/cgmblelib/utils/SharedPreferencesLibraryUtil.java +69 -0
- package/android/src/main/java/cgmblelib/utils/SyncMeta.kt +8 -0
- package/android/src/main/java/cgmblelib/utils/Tool.java +400 -0
- package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +885 -0
- package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibPackage.kt +16 -0
- package/android/src/main/java/com/mytatvarnsdk/MainActivity.kt +404 -0
- package/android/src/main/java/com/mytatvarnsdk/MainApplication.kt +52 -0
- package/android/src/main/java/com/mytatvarnsdk/MyTatvaRnSdkPackage.kt +2 -2
- package/android/src/main/java/com/mytatvarnsdk/MyTatvaRnSdkViewManager.kt +1 -1
- package/android/src/main/java/com/mytatvarnsdk/activity/BtManageActivity.java +427 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +334 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/ExitJourneyBottomSheet.kt +78 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/HelpActivity.kt +70 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +367 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +103 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +145 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/QRActivity.kt +119 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +554 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +156 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +92 -0
- package/android/src/main/java/com/mytatvarnsdk/adapter/AdapterFragment.java +32 -0
- package/android/src/main/java/com/mytatvarnsdk/base/BaseBleActivity.java +223 -0
- package/android/src/main/java/com/mytatvarnsdk/base/BaseLiveDataEventsDistributeActivity.java +301 -0
- package/android/src/main/java/com/mytatvarnsdk/base/BasePermissionActivity.java +383 -0
- package/android/src/main/java/com/mytatvarnsdk/model/AllCGMLogRequest.kt +50 -0
- package/android/src/main/java/com/mytatvarnsdk/model/BaseViewModel.java +109 -0
- package/android/src/main/java/com/mytatvarnsdk/model/GlucoseLog.kt +41 -0
- package/android/src/main/java/com/mytatvarnsdk/model/GlucoseLogRequest.kt +3 -0
- package/android/src/main/java/com/mytatvarnsdk/model/MainActivityModel.java +18 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/CircleImageView.java +110 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/DragActionButton.java +96 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/HistoryItem.java +45 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/Media/CustomMediaPlayer.java +155 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/PagerAdapterWrapper.java +117 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/RtlViewPager.java +361 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/dialog/AlarmDialogManagement.java +115 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/dialog/DialogType.java +88 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/dialog/WarnDialog.java +328 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/dialog/WarnDialogUtils.java +202 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/horizonViewPager/HorizontalViewPage.java +20 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/horizonViewPager/ScaleInTransformer.java +33 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/BPopupWindow.java +166 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/ErrorInfoPop.java +28 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/PermissionRequestPopWindow.java +64 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/PopShowWay.java +16 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/PopupType.java +70 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/PopupWindowManagement.java +191 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/popupwindow/TransmitterConnectPopWindow.java +88 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/progress/BaseCustomProgress.java +55 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/progress/CircularProgressView.java +238 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/progress/ProgressManagement.java +100 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/progress/ProgressType.java +41 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/progress/WaitProgress.java +91 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/widget/SensorGlucoseShow.java +219 -0
- package/android/src/main/java/com/mytatvarnsdk/myView/widget/TransmitterState.java +536 -0
- package/android/src/main/java/com/mytatvarnsdk/network/ApiServiceInterface.kt +22 -0
- package/android/src/main/java/com/mytatvarnsdk/network/AuthenticateSDKService.kt +168 -0
- package/android/src/main/java/com/mytatvarnsdk/receiver/BootCompleteReceiver.java +31 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/CGMTool.java +59 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/DeviceStatus.kt +35 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/EncryptionUtil.kt +98 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/RetrofitInstance.kt +20 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/TatvaEncryptionConfig.kt +20 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/Tatva_Environment.kt +6 -0
- package/android/src/main/res/anim/pop_down_out.xml +12 -0
- package/android/src/main/res/anim/pop_left_right.xml +8 -0
- package/android/src/main/res/anim/pop_right_left.xml +7 -0
- package/android/src/main/res/anim/pop_up_in.xml +11 -0
- package/android/src/main/res/anim/reverse_down_anim.xml +12 -0
- package/android/src/main/res/anim/reverse_up_anim.xml +11 -0
- package/android/src/main/res/color/radio_text_selector.xml +5 -0
- package/android/src/main/res/drawable/bg_blue.xml +6 -0
- package/android/src/main/res/drawable/bg_dark_black.xml +6 -0
- package/android/src/main/res/drawable/bg_darkgray_corner_16.xml +5 -0
- package/android/src/main/res/drawable/bg_design.png +0 -0
- package/android/src/main/res/drawable/bg_gray_corner10.xml +5 -0
- package/android/src/main/res/drawable/bg_green.xml +6 -0
- package/android/src/main/res/drawable/bg_green_border_20.xml +6 -0
- package/android/src/main/res/drawable/bg_light_blue.xml +6 -0
- package/android/src/main/res/drawable/bg_light_green_border_20.xml +7 -0
- package/android/src/main/res/drawable/bg_maincolor_corner5.xml +6 -0
- package/android/src/main/res/drawable/bg_offwhite.xml +6 -0
- package/android/src/main/res/drawable/bg_progressbar.xml +14 -0
- package/android/src/main/res/drawable/bg_red_border_20.xml +6 -0
- package/android/src/main/res/drawable/bg_rounded_gradient.xml +12 -0
- package/android/src/main/res/drawable/bg_transblack_corner_8.xml +5 -0
- package/android/src/main/res/drawable/bg_white_border_20.xml +10 -0
- package/android/src/main/res/drawable/bg_white_corner_10.xml +7 -0
- package/android/src/main/res/drawable/bg_white_corner_8.xml +7 -0
- package/android/src/main/res/drawable/bg_white_green_border_20.xml +7 -0
- package/android/src/main/res/drawable/bg_yellow_bottom.xml +10 -0
- package/android/src/main/res/drawable/bg_yellow_top.xml +10 -0
- package/android/src/main/res/drawable/bottom_sheet_background.xml +8 -0
- package/android/src/main/res/drawable/checked_arrow_up_down.xml +5 -0
- package/android/src/main/res/drawable/circle_black.xml +7 -0
- package/android/src/main/res/drawable/circle_shape.xml +35 -0
- package/android/src/main/res/drawable/custom_radio_icon_selector.xml +5 -0
- package/android/src/main/res/drawable/custom_thumb.xml +6 -0
- package/android/src/main/res/drawable/dialog_warn_button_cancel.xml +11 -0
- package/android/src/main/res/drawable/dialog_warn_button_ok.xml +11 -0
- package/android/src/main/res/drawable/gray_border_15.xml +9 -0
- package/android/src/main/res/drawable/guide_circle.xml +5 -0
- package/android/src/main/res/drawable/hr_button_select.xml +5 -0
- package/android/src/main/res/drawable/hr_normal.xml +13 -0
- package/android/src/main/res/drawable/hr_select.xml +10 -0
- package/android/src/main/res/drawable/ic_charging_case.png +0 -0
- package/android/src/main/res/drawable/ic_close.png +0 -0
- package/android/src/main/res/drawable/ic_close_gray.xml +9 -0
- package/android/src/main/res/drawable/ic_play.xml +9 -0
- package/android/src/main/res/drawable/ic_play_gif.gif +0 -0
- package/android/src/main/res/drawable/ic_rectangle_blue.xml +9 -0
- package/android/src/main/res/drawable/ic_right_arrow.xml +9 -0
- package/android/src/main/res/drawable/ic_sync.xml +9 -0
- package/android/src/main/res/drawable/ic_transmitter.png +0 -0
- package/android/src/main/res/drawable/ic_whatsapp.xml +31 -0
- package/android/src/main/res/drawable/ic_whatsapp_green.xml +28 -0
- package/android/src/main/res/drawable/icon_glucose_hyperglycemia.xml +5 -0
- package/android/src/main/res/drawable/img_box_cross.png +0 -0
- package/android/src/main/res/drawable/img_box_qr.png +0 -0
- package/android/src/main/res/drawable/img_case.png +0 -0
- package/android/src/main/res/drawable/img_cgm_device.png +0 -0
- package/android/src/main/res/drawable/img_cgm_shadow.png +0 -0
- package/android/src/main/res/drawable/img_charging_indicator.png +0 -0
- package/android/src/main/res/drawable/img_charging_pod_full.png +0 -0
- package/android/src/main/res/drawable/img_female.png +0 -0
- package/android/src/main/res/drawable/img_male.png +0 -0
- package/android/src/main/res/drawable/img_trans_shell.png +0 -0
- package/android/src/main/res/drawable/popup_button_confirm_enable.xml +11 -0
- package/android/src/main/res/drawable/popup_window_bg.xml +9 -0
- package/android/src/main/res/drawable/radio_button_background.xml +17 -0
- package/android/src/main/res/drawable/radio_checked.xml +9 -0
- package/android/src/main/res/drawable/radio_unchecked.xml +13 -0
- package/android/src/main/res/drawable/searching.gif +0 -0
- package/android/src/main/res/drawable/sensor_bg.xml +10 -0
- package/android/src/main/res/drawable/success_anim.gif +0 -0
- package/android/src/main/res/drawable/thumb_selector.xml +11 -0
- package/android/src/main/res/drawable/toggle_off.xml +16 -0
- package/android/src/main/res/drawable/toggle_on.xml +16 -0
- package/android/src/main/res/drawable/track_selector.xml +17 -0
- package/android/src/main/res/drawable/warning.gif +0 -0
- package/android/src/main/res/drawable-hdpi/alarm_sound_shake_white.png +0 -0
- package/android/src/main/res/drawable-hdpi/arrow_down.png +0 -0
- package/android/src/main/res/drawable-hdpi/arrow_up.png +0 -0
- package/android/src/main/res/drawable-hdpi/calibration_notice.png +0 -0
- package/android/src/main/res/drawable-hdpi/drop_rapidly.png +0 -0
- package/android/src/main/res/drawable-hdpi/drop_rapidly_low.png +0 -0
- package/android/src/main/res/drawable-hdpi/drop_steadily.png +0 -0
- package/android/src/main/res/drawable-hdpi/home_menu.png +0 -0
- package/android/src/main/res/drawable-hdpi/implentation_step3.png +0 -0
- package/android/src/main/res/drawable-hdpi/implentation_step4.png +0 -0
- package/android/src/main/res/drawable-hdpi/poput_request_permission_icon.png +0 -0
- package/android/src/main/res/drawable-hdpi/product_box.png +0 -0
- package/android/src/main/res/drawable-hdpi/progress_wait_other_icon.png +0 -0
- package/android/src/main/res/drawable-hdpi/rise_rapidly.png +0 -0
- package/android/src/main/res/drawable-hdpi/rise_steadily.png +0 -0
- package/android/src/main/res/drawable-hdpi/sound_close.png +0 -0
- package/android/src/main/res/drawable-hdpi/sound_open.png +0 -0
- package/android/src/main/res/drawable-hdpi/steady.png +0 -0
- package/android/src/main/res/drawable-hdpi/toast_success.png +0 -0
- package/android/src/main/res/drawable-hdpi/video_wait.png +0 -0
- package/android/src/main/res/drawable-xhdpi/alarm_sound_shake_white.png +0 -0
- package/android/src/main/res/drawable-xhdpi/arrow_down.png +0 -0
- package/android/src/main/res/drawable-xhdpi/arrow_up.png +0 -0
- package/android/src/main/res/drawable-xhdpi/arrows_down_white.png +0 -0
- package/android/src/main/res/drawable-xhdpi/bt_qr_img.png +0 -0
- package/android/src/main/res/drawable-xhdpi/calibration_notice.png +0 -0
- package/android/src/main/res/drawable-xhdpi/cgm_img.png +0 -0
- package/android/src/main/res/drawable-xhdpi/chart_point_hypoglycemia.png +0 -0
- package/android/src/main/res/drawable-xhdpi/chart_point_normal.png +0 -0
- package/android/src/main/res/drawable-xhdpi/count_down_icon.png +0 -0
- package/android/src/main/res/drawable-xhdpi/device_unbind.png +0 -0
- package/android/src/main/res/drawable-xhdpi/drop_rapidly.png +0 -0
- package/android/src/main/res/drawable-xhdpi/drop_rapidly_low.png +0 -0
- package/android/src/main/res/drawable-xhdpi/drop_steadily.png +0 -0
- package/android/src/main/res/drawable-xhdpi/friend_share.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step1.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step10.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step2_arm.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step2_fu.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step3.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step4.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step5.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step6.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step7.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step8.png +0 -0
- package/android/src/main/res/drawable-xhdpi/guide_step9.png +0 -0
- package/android/src/main/res/drawable-xhdpi/home_menu.png +0 -0
- package/android/src/main/res/drawable-xhdpi/home_question.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_back.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_ct3.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_glucose_hyperglycemia.png +0 -0
- package/android/src/main/res/drawable-xhdpi/implement_close.png +0 -0
- package/android/src/main/res/drawable-xhdpi/implentation_step2_1.png +0 -0
- package/android/src/main/res/drawable-xhdpi/implentation_step2_2.png +0 -0
- package/android/src/main/res/drawable-xhdpi/implentation_step3.png +0 -0
- package/android/src/main/res/drawable-xhdpi/implentation_step4.png +0 -0
- package/android/src/main/res/drawable-xhdpi/loading_icon.png +0 -0
- package/android/src/main/res/drawable-xhdpi/login_loading.png +0 -0
- package/android/src/main/res/drawable-xhdpi/main_bg.png +0 -0
- package/android/src/main/res/drawable-xhdpi/mes_pop_box_icon.png +0 -0
- package/android/src/main/res/drawable-xhdpi/poput_request_permission_icon.png +0 -0
- package/android/src/main/res/drawable-xhdpi/prepare_box_video.png +0 -0
- package/android/src/main/res/drawable-xhdpi/prepare_products.png +0 -0
- package/android/src/main/res/drawable-xhdpi/product_box.png +0 -0
- package/android/src/main/res/drawable-xhdpi/progress_wait_center.png +0 -0
- package/android/src/main/res/drawable-xhdpi/progress_wait_other_icon.png +0 -0
- package/android/src/main/res/drawable-xhdpi/progress_wait_search.png +0 -0
- package/android/src/main/res/drawable-xhdpi/rise_rapidly.png +0 -0
- package/android/src/main/res/drawable-xhdpi/rise_steadily.png +0 -0
- package/android/src/main/res/drawable-xhdpi/sound_close.png +0 -0
- package/android/src/main/res/drawable-xhdpi/sound_implement.png +0 -0
- package/android/src/main/res/drawable-xhdpi/sound_open.png +0 -0
- package/android/src/main/res/drawable-xhdpi/star.png +0 -0
- package/android/src/main/res/drawable-xhdpi/steady.png +0 -0
- package/android/src/main/res/drawable-xhdpi/title_black.png +0 -0
- package/android/src/main/res/drawable-xhdpi/toast_success.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_drop_rapidly.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_drop_rapidly_low.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_drop_steadily.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_none.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_rise_rapidly.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_rise_steadily.png +0 -0
- package/android/src/main/res/drawable-xhdpi/trend_steady.png +0 -0
- package/android/src/main/res/drawable-xhdpi/triangle_red.png +0 -0
- package/android/src/main/res/drawable-xhdpi/triangle_yellow.png +0 -0
- package/android/src/main/res/drawable-xhdpi/video_wait.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_drop_rapid.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_drop_rapid_low.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_drop_slow.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_rise_rapid.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_rise_slow.png +0 -0
- package/android/src/main/res/drawable-xhdpi/widget_steady.png +0 -0
- package/android/src/main/res/drawable-xhdpi/zoom_in.png +0 -0
- package/android/src/main/res/drawable-xhdpi/zoom_out_white.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/alarm_sound_shake_white.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/calibration_notice.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/drop_rapidly.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/drop_rapidly_low.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/drop_steadily.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/home_menu.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/mes_pop_box_icon.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/poput_request_permission_icon.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/product_box.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/progress_wait_center.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/progress_wait_other_icon.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/rise_rapidly.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/rise_steadily.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/sound_close.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/sound_open.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/steady.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/title_black.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/toast_success.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/video_wait.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/mes_pop_box_icon.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/poput_request_permission_icon.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/progress_wait_other_icon.png +0 -0
- package/android/src/main/res/font/playfairdisplay_bold.ttf +0 -0
- package/android/src/main/res/font/playfairdisplay_medium.ttf +0 -0
- package/android/src/main/res/font/playfairdisplay_regular.ttf +0 -0
- package/android/src/main/res/font/roboto_bold.ttf +0 -0
- package/android/src/main/res/font/roboto_medium.ttf +0 -0
- package/android/src/main/res/font/roboto_regular.ttf +0 -0
- package/android/src/main/res/font/roboto_semibold.ttf +0 -0
- package/android/src/main/res/layout/activity_bt_manage.xml +107 -0
- package/android/src/main/res/layout/activity_cgmdevice.xml +99 -0
- package/android/src/main/res/layout/activity_connect_sensor.xml +415 -0
- package/android/src/main/res/layout/activity_count_down.xml +229 -0
- package/android/src/main/res/layout/activity_guide.xml +118 -0
- package/android/src/main/res/layout/activity_help.xml +188 -0
- package/android/src/main/res/layout/activity_main.xml +48 -0
- package/android/src/main/res/layout/activity_permission.xml +205 -0
- package/android/src/main/res/layout/activity_place_sensor.xml +156 -0
- package/android/src/main/res/layout/activity_place_transmitter.xml +124 -0
- package/android/src/main/res/layout/activity_prepare_step1.xml +191 -0
- package/android/src/main/res/layout/activity_qr.xml +16 -0
- package/android/src/main/res/layout/activity_qractivity.xml +10 -0
- package/android/src/main/res/layout/activity_search_transmitter.xml +667 -0
- package/android/src/main/res/layout/activity_sensor_connect_success.xml +101 -0
- package/android/src/main/res/layout/activity_start_cgmactivity.xml +175 -0
- package/android/src/main/res/layout/activity_transmitter_list.xml +38 -0
- package/android/src/main/res/layout/activity_transmitter_state.xml +74 -0
- package/android/src/main/res/layout/activity_trend_detail.xml +287 -0
- package/android/src/main/res/layout/activity_welcome.xml +11 -0
- package/android/src/main/res/layout/dialog_progress_wait.xml +49 -0
- package/android/src/main/res/layout/dialog_warn.xml +140 -0
- package/android/src/main/res/layout/exit_dialog_bottomsheet.xml +90 -0
- package/android/src/main/res/layout/fragment_count_down.xml +65 -0
- package/android/src/main/res/layout/fragment_prepare.xml +15 -0
- package/android/src/main/res/layout/fragment_sensor.xml +174 -0
- package/android/src/main/res/layout/fragment_sensor_glucose_show.xml +62 -0
- package/android/src/main/res/layout/history_item.xml +92 -0
- package/android/src/main/res/layout/layout_button.xml +56 -0
- package/android/src/main/res/layout/layout_green_border_button.xml +44 -0
- package/android/src/main/res/layout/layout_red_button.xml +43 -0
- package/android/src/main/res/layout/layout_toolbar.xml +61 -0
- package/android/src/main/res/layout/pop_error_info.xml +13 -0
- package/android/src/main/res/layout/popup_window_request_permisson.xml +54 -0
- package/android/src/main/res/layout/popup_window_transmitter_connect.xml +103 -0
- package/android/src/main/res/layout/top_menu_common.xml +95 -0
- package/android/src/main/res/layout/view_loading_button.xml +29 -0
- package/android/src/main/res/raw/high_alarm.mp3 +0 -0
- package/android/src/main/res/raw/medium_alarm.mp3 +0 -0
- package/android/src/main/res/values/colors.xml +44 -0
- package/android/src/main/res/values/dimens.xml +21 -0
- package/android/src/main/res/values/strings.xml +202 -0
- package/android/src/main/res/values/styles.xml +98 -0
- package/ios/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/ios/Assets.xcassets/AppIcon.appiconset/Contents.json +35 -0
- package/ios/Assets.xcassets/CGM_with_Toggle.imageset/CGM_with_Toggle.png +0 -0
- package/ios/Assets.xcassets/CGM_with_Toggle.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/Contents.json +6 -0
- package/ios/Assets.xcassets/Take_out_transmitter.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/Take_out_transmitter.imageset/Take our transmitter.png +0 -0
- package/ios/Assets.xcassets/charging.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/charging.imageset/charging.png +0 -0
- package/ios/Assets.xcassets/charging_pod.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/charging_pod.imageset/charging_pod.png +0 -0
- package/ios/Assets.xcassets/close_pod.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/close_pod.imageset/Group 1000005563.png +0 -0
- package/ios/Assets.xcassets/close_pod.imageset/Group 1000005563@2x.png +0 -0
- package/ios/Assets.xcassets/close_pod.imageset/Group 1000005563@3x.png +0 -0
- package/ios/Assets.xcassets/do_not_place_inside.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/do_not_place_inside.imageset/do_not_place_inside.png +0 -0
- package/ios/Assets.xcassets/flip_the_reference.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/flip_the_reference.imageset/flip_the_reference.png +0 -0
- package/ios/Assets.xcassets/fully_charged.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/fully_charged.imageset/fully_charged.png +0 -0
- package/ios/Assets.xcassets/green.colorset/Contents.json +38 -0
- package/ios/Assets.xcassets/ic_arrow.imageset/7.png +0 -0
- package/ios/Assets.xcassets/ic_arrow.imageset/7@2x.png +0 -0
- package/ios/Assets.xcassets/ic_arrow.imageset/7@3x.png +0 -0
- package/ios/Assets.xcassets/ic_arrow.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_back.imageset/7.png +0 -0
- package/ios/Assets.xcassets/ic_back.imageset/7@2x.png +0 -0
- package/ios/Assets.xcassets/ic_back.imageset/7@3x.png +0 -0
- package/ios/Assets.xcassets/ic_back.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_back_arrow.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_back_arrow.imageset/image 17 (Traced).png +0 -0
- package/ios/Assets.xcassets/ic_back_arrow.imageset/image 17 (Traced)@2x.png +0 -0
- package/ios/Assets.xcassets/ic_back_arrow.imageset/image 17 (Traced)@3x.png +0 -0
- package/ios/Assets.xcassets/ic_circle.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_circle.imageset/circle.png +0 -0
- package/ios/Assets.xcassets/ic_circle.imageset/circle@2x.png +0 -0
- package/ios/Assets.xcassets/ic_circle.imageset/circle@3x.png +0 -0
- package/ios/Assets.xcassets/ic_close.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_close.imageset/close button.png +0 -0
- package/ios/Assets.xcassets/ic_close.imageset/close button@2x.png +0 -0
- package/ios/Assets.xcassets/ic_close.imageset/close button@3x.png +0 -0
- package/ios/Assets.xcassets/ic_close_popup.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_close_popup.imageset/Frame.png +0 -0
- package/ios/Assets.xcassets/ic_close_popup.imageset/Frame@2x.png +0 -0
- package/ios/Assets.xcassets/ic_close_popup.imageset/Frame@3x.png +0 -0
- package/ios/Assets.xcassets/ic_green_arrow.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_green_arrow.imageset/image 17 (Traced).png +0 -0
- package/ios/Assets.xcassets/ic_green_arrow.imageset/image 17 (Traced)@2x.png +0 -0
- package/ios/Assets.xcassets/ic_green_arrow.imageset/image 17 (Traced)@3x.png +0 -0
- package/ios/Assets.xcassets/ic_play.imageset/Contents.json +26 -0
- package/ios/Assets.xcassets/ic_play.imageset/Play.png +0 -0
- package/ios/Assets.xcassets/ic_play.imageset/Play@2x.png +0 -0
- package/ios/Assets.xcassets/ic_play.imageset/Play@3x.png +0 -0
- package/ios/Assets.xcassets/ic_selected.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_selected.imageset/Frame.png +0 -0
- package/ios/Assets.xcassets/ic_selected.imageset/Frame@2x.png +0 -0
- package/ios/Assets.xcassets/ic_selected.imageset/Frame@3x.png +0 -0
- package/ios/Assets.xcassets/ic_whatsApp_only.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_whatsApp_only.imageset/WhatsApp.png +0 -0
- package/ios/Assets.xcassets/ic_whatsApp_only.imageset/WhatsApp@2x.png +0 -0
- package/ios/Assets.xcassets/ic_whatsApp_only.imageset/WhatsApp@3x.png +0 -0
- package/ios/Assets.xcassets/ic_whatsapp.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/ic_whatsapp.imageset/Frame 1000006343.png +0 -0
- package/ios/Assets.xcassets/ic_whatsapp.imageset/Frame 1000006343@2x.png +0 -0
- package/ios/Assets.xcassets/ic_whatsapp.imageset/Frame 1000006343@3x.png +0 -0
- package/ios/Assets.xcassets/indigo.colorset/Contents.json +38 -0
- package/ios/Assets.xcassets/mandala.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/mandala.imageset/ending.png +0 -0
- package/ios/Assets.xcassets/open_pod.imageset/Contents.json +23 -0
- package/ios/Assets.xcassets/open_pod.imageset/Screenshot 2025-04-22 at 8.07.34/342/200/257PM 1.png +0 -0
- package/ios/Assets.xcassets/open_pod.imageset/Screenshot 2025-04-22 at 8.07.34/342/200/257PM 1@2x.png +0 -0
- package/ios/Assets.xcassets/open_pod.imageset/Screenshot 2025-04-22 at 8.07.34/342/200/257PM 1@3x.png +0 -0
- package/ios/Assets.xcassets/step4.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/step4.imageset/step4.png +0 -0
- package/ios/Assets.xcassets/step5.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/step5.imageset/step5.png +0 -0
- package/ios/Assets.xcassets/transmitter_image.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/transmitter_image.imageset/transmitter_image.png +0 -0
- package/ios/Assets.xcassets/transmitter_shadow.imageset/CGM Shadow.png +0 -0
- package/ios/Assets.xcassets/transmitter_shadow.imageset/Contents.json +21 -0
- package/ios/Assets.xcassets/unselectedGray.colorset/Contents.json +38 -0
- package/ios/Custom/CustomColor.swift +22 -0
- package/ios/Custom/CustomFont.swift +49 -0
- package/ios/Custom/CustomOverlayButton.swift +237 -0
- package/ios/Custom/CustomStepProgressBar.swift +167 -0
- package/ios/Custom/CustomTopUIView.swift +173 -0
- package/ios/Custom/CustomView.swift +60 -0
- package/ios/Database/Advertise+CoreDataClass.h +23 -0
- package/ios/Database/Advertise+CoreDataClass.m +14 -0
- package/ios/Database/Advertise+CoreDataProperties.h +28 -0
- package/ios/Database/Advertise+CoreDataProperties.m +25 -0
- package/ios/Database/Device+CoreDataClass.h +23 -0
- package/ios/Database/Device+CoreDataClass.m +14 -0
- package/ios/Database/Device+CoreDataProperties.h +47 -0
- package/ios/Database/Device+CoreDataProperties.m +30 -0
- package/ios/Database/GlucoseData+CoreDataClass.h +23 -0
- package/ios/Database/GlucoseData+CoreDataClass.m +14 -0
- package/ios/Database/GlucoseData+CoreDataProperties.h +37 -0
- package/ios/Database/GlucoseData+CoreDataProperties.m +34 -0
- package/ios/Database/KLTAppDelegate.h +24 -0
- package/ios/Database/KLTAppDelegate.m +109 -0
- package/ios/Database/KLTBluetoothManager.h +83 -0
- package/ios/Database/KLTBluetoothManager.m +723 -0
- package/ios/Database/KLTCommonDefine.h +52 -0
- package/ios/Database/KLTDatabaseHandler.h +59 -0
- package/ios/Database/KLTDatabaseHandler.m +437 -0
- package/ios/Database/KLTFormat.h +32 -0
- package/ios/Database/KLTFormat.m +270 -0
- package/ios/Database/KLTLaunchConfiguration.h +37 -0
- package/ios/Database/KLTLaunchConfiguration.m +96 -0
- package/ios/Database/KLTLocalSettingManager.h +38 -0
- package/ios/Database/KLTLocalSettingManager.m +138 -0
- package/ios/Database/KLTPrefixHeader.pch +123 -0
- package/ios/Database/KLTRunLog.h +36 -0
- package/ios/Database/KLTRunLog.m +156 -0
- package/ios/Database/KLTUserDefautKeyDefine.h +42 -0
- package/ios/Database/MyTatva.xcdatamodeld/MyTatva.xcdatamodel/contents +68 -0
- package/ios/Database/NSString+KLTDateString.h +36 -0
- package/ios/Database/NSString+KLTDateString.m +160 -0
- package/ios/Database/ReceiveData+CoreDataClass.h +23 -0
- package/ios/Database/ReceiveData+CoreDataClass.m +14 -0
- package/ios/Database/ReceiveData+CoreDataProperties.h +47 -0
- package/ios/Database/ReceiveData+CoreDataProperties.m +44 -0
- package/ios/Database/UIColor+KLTUI.h +36 -0
- package/ios/Database/UIColor+KLTUI.m +60 -0
- package/ios/Extension/UIColor+Extension.swift +23 -0
- package/ios/Extension/UIImageView+Extension.swift +59 -0
- package/ios/Extension/UITableView+Extension.swift +37 -0
- package/ios/Extension/UIViewController+Extension.swift +24 -0
- package/ios/LaunchScreen.storyboard +47 -0
- package/ios/MyReactNativeBridge.h +19 -0
- package/ios/MyReactNativeBridge.m +36 -0
- package/ios/MyTatvaCare-Bridging-Header.h +23 -0
- package/ios/MyTatvaRnSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/MyTatvaRnSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/MyTatvaRnSdk.xcodeproj/project.xcworkspace/xcuserdata/sonusharma.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/MyTatvaRnSdk.xcodeproj/xcuserdata/sonusharma.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/MyTatvaRnSdkViewManager.h +1 -1
- package/ios/MyTatvaRnSdkViewManager.m +1 -1
- package/ios/Storyboard/Base.lproj/LaunchScreen.storyboard +25 -0
- package/ios/Storyboard/Base.lproj/Main.storyboard +858 -0
- package/ios/Support/API.swift +325 -0
- package/ios/Support/BluetoothManager.swift +472 -0
- package/ios/Support/Converter/DataConverter.swift +34 -0
- package/ios/Support/Enum.swift +37 -0
- package/ios/Support/EnumDebouncer.swift +55 -0
- package/ios/Support/Font/PlayfairDisplay-Italic-VariableFont_wght.ttf +0 -0
- package/ios/Support/Font/PlayfairDisplay-VariableFont_wght.ttf +0 -0
- package/ios/Support/Global.swift +12 -0
- package/ios/Support/KLTFormat.swift +151 -0
- package/ios/Support/Library/SDK/include/AlgorithmTools.h +52 -0
- package/ios/Support/Library/SDK/include/CGMAlgo.h +224 -0
- package/ios/Support/Library/SDK/include/CGMCommonDefine.h +176 -0
- package/ios/Support/Library/SDK/include/CurrentGlucose.h +412 -0
- package/ios/Support/Library/SDK/include/EDevice.h +78 -0
- package/ios/Support/Library/SDK/include/KRDecodeData.h +45 -0
- package/ios/Support/Library/SDK/libCGMAlgo.a +0 -0
- package/ios/Support/gif/failure.gif +0 -0
- package/ios/Support/gif/play.gif +0 -0
- package/ios/Support/gif/searching.gif +0 -0
- package/ios/Support/gif/shrimmer.gif +0 -0
- package/ios/TableViewCell/ChargingIndicatorTVC/ChargingIndicatorTVC.swift +45 -0
- package/ios/TableViewCell/ChargingIndicatorTVC/ChargingIndicatorTVC.xib +136 -0
- package/ios/TableViewCell/ChatOptionTVC/ChatOptionTVC.swift +34 -0
- package/ios/TableViewCell/ChatOptionTVC/ChatOptionTVC.xib +85 -0
- package/ios/TableViewCell/ConnectDeviceTVC/ConnectDeviceTVC.swift +38 -0
- package/ios/TableViewCell/ConnectDeviceTVC/ConnectDeviceTVC.xib +94 -0
- package/ios/TableViewCell/ConnectSuccessTVC/ConnectSuccessTVC.swift +52 -0
- package/ios/TableViewCell/ConnectSuccessTVC/ConnectSuccessTVC.xib +113 -0
- package/ios/TableViewCell/ImageTVC/ImageTVC.swift +123 -0
- package/ios/TableViewCell/ImageTVC/ImageTVC.xib +115 -0
- package/ios/TableViewCell/LabelTVC/LabelTVC.swift +26 -0
- package/ios/TableViewCell/LabelTVC/LabelTVC.xib +41 -0
- package/ios/TableViewCell/NoteTVC/NoteTVC.swift +58 -0
- package/ios/TableViewCell/NoteTVC/NoteTVC.xib +98 -0
- package/ios/TableViewCell/PodDetailsTVC/PodDetailsTVC.swift +31 -0
- package/ios/TableViewCell/PodDetailsTVC/PodDetailsTVC.xib +104 -0
- package/ios/TableViewCell/SearchDeviceTVC/SearchDeviceTVC.swift +28 -0
- package/ios/TableViewCell/SearchDeviceTVC/SearchDeviceTVC.xib +67 -0
- package/ios/TableViewCell/SeparatorTVC/SeparatorTVC.swift +23 -0
- package/ios/TableViewCell/SeparatorTVC/SeparatorTVC.xib +39 -0
- package/ios/TableViewCell/SwitchTVC/SwitchTVC.swift +52 -0
- package/ios/TableViewCell/SwitchTVC/SwitchTVC.xib +139 -0
- package/ios/TableViewCell/VIdeoTVC/VideoTVC.swift +28 -0
- package/ios/TableViewCell/VIdeoTVC/VideoTVC.xib +79 -0
- package/ios/TableViewCell/VerticalLabelsTVC/VerticalLabelsTVC.swift +37 -0
- package/ios/TableViewCell/VerticalLabelsTVC/VerticalLabelsTVC.xib +60 -0
- package/ios/TableViewCell/WatchVideoTVC/WatchVideoTVC.swift +37 -0
- package/ios/TableViewCell/WatchVideoTVC/WatchVideoTVC.xib +115 -0
- package/ios/ViewControllers/AttachTransmitterViewController.swift +115 -0
- package/ios/ViewControllers/ChatWithExpertViewController.swift +113 -0
- package/ios/ViewControllers/ConnectToSensorViewController.swift +368 -0
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +300 -0
- package/ios/ViewControllers/ExitJourneyViewController.swift +62 -0
- package/ios/ViewControllers/ProvidePermissionViewController.swift +286 -0
- package/ios/ViewControllers/PutOnTheSensorViewController.swift +99 -0
- package/ios/ViewControllers/StartConnectionViewController.swift +117 -0
- package/ios/ViewModel/FinalViewModel.swift +395 -0
- package/lib/commonjs/BcaDeviceListSheet.js +7 -6
- package/lib/commonjs/BcaDeviceListSheet.js.map +1 -1
- package/lib/commonjs/CGMConnect.js +108 -0
- package/lib/commonjs/CGMConnect.js.map +1 -0
- package/lib/commonjs/MainWebView.js +9 -5
- package/lib/commonjs/MainWebView.js.map +1 -1
- package/lib/commonjs/{index.android.js → MyTatvaRnSdkView.android.js} +44 -5
- package/lib/commonjs/MyTatvaRnSdkView.android.js.map +1 -0
- package/lib/commonjs/{index.ios.js → MyTatvaRnSdkView.ios.js} +37 -8
- package/lib/commonjs/MyTatvaRnSdkView.ios.js.map +1 -0
- package/lib/commonjs/ProgressWebView.js +14 -13
- package/lib/commonjs/ProgressWebView.js.map +1 -1
- package/lib/commonjs/Services.js.map +1 -1
- package/lib/commonjs/Sheets.js.map +1 -1
- package/lib/commonjs/api/auth.js.map +1 -1
- package/lib/commonjs/api/base.js +6 -4
- package/lib/commonjs/api/base.js.map +1 -1
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/constants/asyncstorage.js.map +1 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/helpers/Matrics.js +1 -1
- package/lib/commonjs/helpers/Matrics.js.map +1 -1
- package/lib/commonjs/helpers/bluetoothPermissionHelper.js.map +1 -1
- package/lib/commonjs/helpers/colors.js.map +1 -1
- package/lib/commonjs/helpers/common.js.map +1 -1
- package/lib/commonjs/helpers/fonts.js.map +1 -1
- package/lib/commonjs/helpers/globalStyles.js +27 -27
- package/lib/commonjs/helpers/globalStyles.js.map +1 -1
- package/lib/commonjs/helpers/icons.js.map +1 -1
- package/lib/commonjs/index.js +67 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/redux/Store.js +17 -12
- package/lib/commonjs/redux/Store.js.map +1 -1
- package/lib/commonjs/redux/hooks.js +4 -6
- package/lib/commonjs/redux/hooks.js.map +1 -1
- package/lib/commonjs/redux/sagas/AuthSaga.js +11 -18
- package/lib/commonjs/redux/sagas/AuthSaga.js.map +1 -1
- package/lib/commonjs/redux/sagas/index.js.map +1 -1
- package/lib/commonjs/redux/slices/authSlice.js.map +1 -1
- package/lib/commonjs/redux/slices/index.js +1 -2
- package/lib/commonjs/redux/slices/index.js.map +1 -1
- package/lib/commonjs/types/action-sheet.d.js +2 -0
- package/lib/commonjs/types/action-sheet.d.js.map +1 -0
- package/lib/commonjs/types/auth.js.map +1 -1
- package/lib/commonjs/types/common.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -2
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/sheet-manager.d.js +2 -0
- package/lib/commonjs/types/sheet-manager.d.js.map +1 -0
- package/lib/commonjs/types/svg.d.js +2 -0
- package/lib/commonjs/types/svg.d.js.map +1 -0
- package/lib/module/BcaDeviceListSheet.js +6 -4
- package/lib/module/BcaDeviceListSheet.js.map +1 -1
- package/lib/module/CGMConnect.js +94 -0
- package/lib/module/CGMConnect.js.map +1 -0
- package/lib/module/MainWebView.js +9 -5
- package/lib/module/MainWebView.js.map +1 -1
- package/lib/module/{index.android.js → MyTatvaRnSdkView.android.js} +44 -4
- package/lib/module/MyTatvaRnSdkView.android.js.map +1 -0
- package/lib/module/{index.ios.js → MyTatvaRnSdkView.ios.js} +37 -7
- package/lib/module/MyTatvaRnSdkView.ios.js.map +1 -0
- package/lib/module/ProgressWebView.js +14 -9
- package/lib/module/ProgressWebView.js.map +1 -1
- package/lib/module/Services.js.map +1 -1
- package/lib/module/Sheets.js.map +1 -1
- package/lib/module/api/auth.js.map +1 -1
- package/lib/module/api/base.js +6 -4
- package/lib/module/api/base.js.map +1 -1
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/constants/asyncstorage.js.map +1 -1
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/helpers/Matrics.js +1 -1
- package/lib/module/helpers/Matrics.js.map +1 -1
- package/lib/module/helpers/bluetoothPermissionHelper.js.map +1 -1
- package/lib/module/helpers/colors.js.map +1 -1
- package/lib/module/helpers/common.js.map +1 -1
- package/lib/module/helpers/fonts.js.map +1 -1
- package/lib/module/helpers/globalStyles.js +1 -1
- package/lib/module/helpers/globalStyles.js.map +1 -1
- package/lib/module/helpers/icons.js.map +1 -1
- package/lib/module/index.js +28 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/redux/Store.js +17 -10
- package/lib/module/redux/Store.js.map +1 -1
- package/lib/module/redux/hooks.js +3 -1
- package/lib/module/redux/hooks.js.map +1 -1
- package/lib/module/redux/sagas/AuthSaga.js +9 -16
- package/lib/module/redux/sagas/AuthSaga.js.map +1 -1
- package/lib/module/redux/sagas/index.js.map +1 -1
- package/lib/module/redux/slices/authSlice.js.map +1 -1
- package/lib/module/redux/slices/index.js.map +1 -1
- package/lib/module/types/action-sheet.d.js +2 -0
- package/lib/module/types/action-sheet.d.js.map +1 -0
- package/lib/module/types/auth.js.map +1 -1
- package/lib/module/types/common.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/sheet-manager.d.js +2 -0
- package/lib/module/types/sheet-manager.d.js.map +1 -0
- package/lib/module/types/svg.d.js +2 -0
- package/lib/module/types/svg.d.js.map +1 -0
- package/lib/typescript/BcaDeviceListSheet.d.ts +8 -3
- package/lib/typescript/CGMConnect.d.ts +8 -0
- package/lib/typescript/MainWebView.d.ts +0 -1
- package/lib/typescript/ProgressWebView.d.ts +0 -1
- package/lib/typescript/api/auth.d.ts +0 -1
- package/lib/typescript/api/base.d.ts +0 -1
- package/lib/typescript/api/index.d.ts +0 -1
- package/lib/typescript/constants/asyncstorage.d.ts +0 -1
- package/lib/typescript/constants/constants.d.ts +0 -1
- package/lib/typescript/constants.d.ts +0 -1
- package/lib/typescript/helpers/Matrics.d.ts +0 -1
- package/lib/typescript/helpers/bluetoothPermissionHelper.d.ts +0 -1
- package/lib/typescript/helpers/colors.d.ts +0 -1
- package/lib/typescript/helpers/common.d.ts +0 -1
- package/lib/typescript/helpers/fonts.d.ts +0 -1
- package/lib/typescript/helpers/globalStyles.d.ts +26 -27
- package/lib/typescript/helpers/icons.d.ts +4 -4
- package/lib/typescript/redux/Store.d.ts +5 -7
- package/lib/typescript/redux/hooks.d.ts +1 -1
- package/lib/typescript/redux/sagas/AuthSaga.d.ts +2 -3
- package/lib/typescript/redux/sagas/index.d.ts +0 -1
- package/lib/typescript/redux/slices/authSlice.d.ts +0 -1
- package/lib/typescript/redux/slices/index.d.ts +0 -1
- package/lib/typescript/types/auth.d.ts +0 -1
- package/lib/typescript/types/common.d.ts +0 -1
- package/lib/typescript/types/index.d.ts +0 -1
- package/package.json +14 -11
- package/src/BcaDeviceListSheet.tsx +20 -9
- package/src/CGMConnect.ts +118 -0
- package/src/{index.android.js → MyTatvaRnSdkView.android.js} +95 -39
- package/src/{index.ios.js → MyTatvaRnSdkView.ios.js} +14 -0
- package/src/ProgressWebView.tsx +2 -1
- package/src/helpers/Matrics.ts +1 -1
- package/src/helpers/globalStyles.ts +1 -1
- package/src/index.js +33 -0
- package/src/redux/Store.ts +21 -12
- package/src/redux/hooks.ts +3 -1
- package/src/redux/sagas/AuthSaga.ts +30 -36
- package/src/types/action-sheet.d.ts +22 -0
- package/src/types/sheet-manager.d.ts +14 -0
- package/src/types/svg.d.ts +5 -0
- package/lib/commonjs/index.android.js.map +0 -1
- package/lib/commonjs/index.ios.js.map +0 -1
- package/lib/module/index.android.js.map +0 -1
- package/lib/module/index.ios.js.map +0 -1
- package/lib/typescript/BcaDeviceListSheet.d.ts.map +0 -1
- package/lib/typescript/MainWebView.d.ts.map +0 -1
- package/lib/typescript/ProgressWebView.d.ts.map +0 -1
- package/lib/typescript/Services.d.ts +0 -5
- package/lib/typescript/Services.d.ts.map +0 -1
- package/lib/typescript/Sheets.d.ts +0 -2
- package/lib/typescript/Sheets.d.ts.map +0 -1
- package/lib/typescript/api/auth.d.ts.map +0 -1
- package/lib/typescript/api/base.d.ts.map +0 -1
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/constants/asyncstorage.d.ts.map +0 -1
- package/lib/typescript/constants/constants.d.ts.map +0 -1
- package/lib/typescript/constants.d.ts.map +0 -1
- package/lib/typescript/helpers/Matrics.d.ts.map +0 -1
- package/lib/typescript/helpers/bluetoothPermissionHelper.d.ts.map +0 -1
- package/lib/typescript/helpers/colors.d.ts.map +0 -1
- package/lib/typescript/helpers/common.d.ts.map +0 -1
- package/lib/typescript/helpers/fonts.d.ts.map +0 -1
- package/lib/typescript/helpers/globalStyles.d.ts.map +0 -1
- package/lib/typescript/helpers/icons.d.ts.map +0 -1
- package/lib/typescript/index.android.d.ts +0 -30
- package/lib/typescript/index.android.d.ts.map +0 -1
- package/lib/typescript/index.ios.d.ts +0 -28
- package/lib/typescript/index.ios.d.ts.map +0 -1
- package/lib/typescript/redux/Store.d.ts.map +0 -1
- package/lib/typescript/redux/hooks.d.ts.map +0 -1
- package/lib/typescript/redux/sagas/AuthSaga.d.ts.map +0 -1
- package/lib/typescript/redux/sagas/index.d.ts.map +0 -1
- package/lib/typescript/redux/slices/authSlice.d.ts.map +0 -1
- package/lib/typescript/redux/slices/index.d.ts.map +0 -1
- package/lib/typescript/types/auth.d.ts.map +0 -1
- package/lib/typescript/types/common.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts.map +0 -1
- /package/ios/{MyTatvaRnSdk.xcodeproj → VisitRnSdk.xcodeproj}/project.pbxproj +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FinalViewModel.swift
|
|
3
|
+
// MyTatvaCare
|
|
4
|
+
//
|
|
5
|
+
// Created by Nirav Ramani on 31/05/25.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
class FinalViewModel: NSObject {
|
|
10
|
+
var initialPeriod = 0
|
|
11
|
+
var totalSeconds : TimeInterval = 60 * 60
|
|
12
|
+
|
|
13
|
+
let manager: KLTBluetoothManager!
|
|
14
|
+
|
|
15
|
+
var countdownTimer: Timer?
|
|
16
|
+
var startScanTimer: Timer?
|
|
17
|
+
|
|
18
|
+
let debouncer = EnumDebouncer<CGMConnectionStatus>()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
// Wait an hour, then you’ll get the success callback if type hasn't changed
|
|
22
|
+
override init() {
|
|
23
|
+
self.manager = KLTBluetoothManager.shared()
|
|
24
|
+
super.init()
|
|
25
|
+
debouncer.onDebounceSuccess = { value in
|
|
26
|
+
API.shared.sendStatus(status: value)
|
|
27
|
+
print("Same type held for an hour!")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func initialize() {
|
|
33
|
+
startCountDown()
|
|
34
|
+
if ((manager.connectedPeripheral == nil) && !KLTLocalSettingManager.shareInstance().canConnectOtherDevice) {
|
|
35
|
+
manager.startScan()
|
|
36
|
+
} else {
|
|
37
|
+
debouncer.update(with: .connected)
|
|
38
|
+
API.shared.sendStatus(status: .connected)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
func startCountDown() {
|
|
42
|
+
// Most recently connected device
|
|
43
|
+
if let last = manager.currentDevice {
|
|
44
|
+
// Calculate initialization countdown time
|
|
45
|
+
if let beginDate = KLTDateFormatter.shared.getDateFromWholeString(last.initialBeginDate ?? "") {
|
|
46
|
+
let time = Date().timeIntervalSince(beginDate)
|
|
47
|
+
totalSeconds = Double(initialPeriod) - TimeInterval(time)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//for countdownlabel
|
|
52
|
+
print(String.getTimeString(with: Int(totalSeconds)))
|
|
53
|
+
|
|
54
|
+
if countdownTimer != nil {
|
|
55
|
+
countdownTimer?.invalidate()
|
|
56
|
+
countdownTimer = nil
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
countdownTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(countdown), userInfo: nil, repeats: true)
|
|
60
|
+
|
|
61
|
+
addAllObservers()
|
|
62
|
+
}
|
|
63
|
+
func addAllObservers() {
|
|
64
|
+
manager.addObserver(self, forKeyPath: "status", options: .new, context: nil)
|
|
65
|
+
|
|
66
|
+
NotificationCenter.default.addObserver(self, selector: #selector(bluetoothEnable(_:)), name: NSNotification.Name("BluetoothEnable"), object: nil)
|
|
67
|
+
|
|
68
|
+
NotificationCenter.default.addObserver(self, selector: #selector(errorStatusFromTransmitter(_:)), name: NSNotification.Name("ErrorStatusFromTransmitter"), object: nil)
|
|
69
|
+
|
|
70
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleLatestReceiveData(_:)), name: NSNotification.Name(KLTAlertCurrentInInitialNotify), object: nil)
|
|
71
|
+
|
|
72
|
+
NotificationCenter.default.addObserver(self, selector: #selector(updateData(_:)), name: NSNotification.Name(KLTUpdateDataNotify), object: nil)
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
func removeAllObservers() {
|
|
77
|
+
manager.removeObserver(self, forKeyPath: "status")
|
|
78
|
+
|
|
79
|
+
NotificationCenter.default.removeObserver(self, name: NSNotification.Name("BluetoothEnable"), object: nil)
|
|
80
|
+
|
|
81
|
+
NotificationCenter.default.removeObserver(self, name: NSNotification.Name("ErrorStatusFromTransmitter"), object: nil)
|
|
82
|
+
|
|
83
|
+
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(KLTAlertCurrentInInitialNotify), object: nil)
|
|
84
|
+
|
|
85
|
+
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(KLTUpdateDataNotify), object: nil)
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
func uploadData(data: [ReceiveData]) {
|
|
91
|
+
let batchSize = 40
|
|
92
|
+
let batches = stride(from: 0, to: data.count, by: batchSize).map {
|
|
93
|
+
Array(data[$0..<min($0 + batchSize, data.count)])
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
uploadBatch(batches: batches, index: 0)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private func uploadBatch(batches: [[ReceiveData]], index: Int) {
|
|
100
|
+
guard index < batches.count else {
|
|
101
|
+
print("✅ All batches uploaded")
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let batch = batches[index]
|
|
106
|
+
let cgmLogs = batch.map { ReceiveDataToLog(data: $0) }
|
|
107
|
+
let payload = Payload(logs: cgmLogs)
|
|
108
|
+
|
|
109
|
+
API.shared.postCGMData(environment: .stage, data: payload) {
|
|
110
|
+
print("✅ Batch \(index + 1) uploaded successfully")
|
|
111
|
+
KLTDatabaseHandler.shared().deleteReceiveDataArray(batch)
|
|
112
|
+
self.uploadBatch(batches: batches, index: index + 1)
|
|
113
|
+
} onFailure: { error in
|
|
114
|
+
print("❌ Failed to upload batch \(index + 1): \(String(describing: error?.localizedDescription))")
|
|
115
|
+
// Optionally retry or stop here
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@objc func updateData(_ notification: Notification) {
|
|
120
|
+
let data = KLTDatabaseHandler.shared().queryAllReceiveData() as! [ReceiveData]
|
|
121
|
+
print(data)
|
|
122
|
+
print("===> all data count: ", data.count)
|
|
123
|
+
KLTDatabaseHandler.shared().reloadQueryHistoryData()
|
|
124
|
+
if let device = KLTBluetoothManager.shared().currentDevice {
|
|
125
|
+
let arrayFromInitial = KLTDatabaseHandler.shared().queryReceiveData(with: device, needUserBG: true) as! [ReceiveData]
|
|
126
|
+
print(arrayFromInitial)
|
|
127
|
+
print("===> arrayFromInitial count: ", arrayFromInitial.count)
|
|
128
|
+
self.uploadData(data: arrayFromInitial)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@objc func errorStatusFromTransmitter(_ notification: Notification) {
|
|
133
|
+
guard let receiveData = notification.object as? ReceiveData else { return }
|
|
134
|
+
|
|
135
|
+
let errorCode = ErrorCode(rawValue: Int32(receiveData.error?.intValue ?? 0))
|
|
136
|
+
if errorCode == ErrorCode.ERROR_CODE_FLOODING_WATER {
|
|
137
|
+
API.shared.sendStatus(status: .moistureDetect)
|
|
138
|
+
} else if errorCode == ErrorCode.ERROR_CODE_CURRENT_SMALL || errorCode == ErrorCode.ERROR_CODE_NOISE || errorCode == ErrorCode.ERROR_CODE_SENSITIVITY_ATTENUATION {
|
|
139
|
+
API.shared.sendStatus(status: .weakSignal)
|
|
140
|
+
} else if errorCode != ErrorCode.ERROR_CODE_NONE {
|
|
141
|
+
API.shared.sendStatus(status: .errorCommon)
|
|
142
|
+
}
|
|
143
|
+
if receiveData.countdownDays == 0 && receiveData.countdownHours == 0 && receiveData.countdownMinutes == 0 {
|
|
144
|
+
API.shared.sendStatus(status: .expired)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@objc func handleLatestReceiveData(_ notification: Notification) {
|
|
149
|
+
print("====> handleLatestReceiveData")
|
|
150
|
+
guard let receiveData = notification.object as? ReceiveData else { return }
|
|
151
|
+
|
|
152
|
+
let errorCode = ErrorCode(rawValue: Int32(receiveData.error?.intValue ?? 0))
|
|
153
|
+
|
|
154
|
+
let hasExceptionCurrent: Bool = (errorCode == ErrorCode.ERROR_CODE_CURRENT_SMALL || errorCode == ErrorCode.ERROR_CODE_NOISE ||
|
|
155
|
+
errorCode == ErrorCode.ERROR_CODE_SENSITIVITY_ATTENUATION || errorCode == ErrorCode.ERROR_CODE_TAKE_OFF ||
|
|
156
|
+
errorCode == ErrorCode.ERROR_CODE_BREAKAGE || errorCode == ErrorCode.ERROR_CODE_TOUCH ||
|
|
157
|
+
errorCode == ErrorCode.ERROR_CODE_FLOODING_WATER)
|
|
158
|
+
|
|
159
|
+
if hasExceptionCurrent {
|
|
160
|
+
guard let startDate = KLTFormat.getDate(from: manager.currentDevice.initialBeginDate ?? "") else { return }
|
|
161
|
+
|
|
162
|
+
// Get current UTC date from local date string
|
|
163
|
+
let now = Date()
|
|
164
|
+
let nowString = KLTDateFormatter.shared.getWholeString(from: now)
|
|
165
|
+
let utcDateString = KLTDateFormatter.shared.getUTCFormatDate(from: nowString) ?? ""
|
|
166
|
+
guard let currentDate = KLTDateFormatter.shared.getDateFromWholeString(utcDateString) else { return }
|
|
167
|
+
|
|
168
|
+
let seconds = Calendar(identifier: .gregorian)
|
|
169
|
+
.dateComponents([.second], from: startDate, to: currentDate).second ?? 0
|
|
170
|
+
|
|
171
|
+
let minutes = seconds / 60
|
|
172
|
+
if minutes > 17 {
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
@objc func bluetoothEnable(_ notification: Notification) {
|
|
178
|
+
if let isBluetoothEnabled = notification.object as? Bool {
|
|
179
|
+
if !isBluetoothEnabled {
|
|
180
|
+
API.shared.sendStatus(status: .bluetoothOff)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if ((manager.connectedPeripheral == nil) && !KLTLocalSettingManager.shareInstance().canConnectOtherDevice) {
|
|
184
|
+
manager.startScan()
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
@objc func countdown() {
|
|
188
|
+
if let last = KLTDatabaseHandler.shared().isLatestDeviceDisconnected() {
|
|
189
|
+
if let beginDate = KLTDateFormatter.shared.getDateFromWholeString(last.initialBeginDate ?? "") {
|
|
190
|
+
let time = Date().timeIntervalSince(beginDate)
|
|
191
|
+
totalSeconds = TimeInterval(3600 - Int(time))
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if totalSeconds <= 0 {
|
|
196
|
+
countdownTimer?.invalidate()
|
|
197
|
+
countdownTimer = nil
|
|
198
|
+
|
|
199
|
+
startScanTimer?.invalidate()
|
|
200
|
+
startScanTimer = nil
|
|
201
|
+
|
|
202
|
+
removeAllObservers()
|
|
203
|
+
|
|
204
|
+
//KLTLaunchConfiguration.sharedManager.resetRootViewController(type: .normalUsed)
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
totalSeconds -= 1
|
|
209
|
+
print(String.getTimeString(with: Int(totalSeconds)))
|
|
210
|
+
//countDownValueLabel.text =
|
|
211
|
+
}
|
|
212
|
+
override func observeValue(
|
|
213
|
+
forKeyPath keyPath: String?,
|
|
214
|
+
of object: Any?,
|
|
215
|
+
change: [NSKeyValueChangeKey : Any]?,
|
|
216
|
+
context: UnsafeMutableRawPointer?
|
|
217
|
+
) {
|
|
218
|
+
guard keyPath == "status",
|
|
219
|
+
let newValue = change?[.newKey] as? Int,
|
|
220
|
+
let status = BluetoothManagerStatus(rawValue: newValue) else {
|
|
221
|
+
return
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
switch status {
|
|
225
|
+
case .disconnected:
|
|
226
|
+
if KLTLocalSettingManager.shareInstance().canConnectOtherDevice {
|
|
227
|
+
// Unbind then disconnect
|
|
228
|
+
endBleSensorCycle()
|
|
229
|
+
} else {
|
|
230
|
+
if UserDefaults.standard.integer(forKey: "bgmode") != 1 {
|
|
231
|
+
manager.startScan()
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
API.shared.sendStatus(status: .disconnected)
|
|
235
|
+
print("===>device is disconnected")
|
|
236
|
+
debouncer.update(with: CGMConnectionStatus.connected)
|
|
237
|
+
case .connected:
|
|
238
|
+
if let timer = startScanTimer {
|
|
239
|
+
timer.invalidate()
|
|
240
|
+
startScanTimer = nil
|
|
241
|
+
}
|
|
242
|
+
API.shared.sendStatus(status: .connected)
|
|
243
|
+
print("===>device is connected")
|
|
244
|
+
debouncer.update(with: CGMConnectionStatus.disconnected)
|
|
245
|
+
case .timeOut:
|
|
246
|
+
if !KLTLocalSettingManager.shareInstance().canConnectOtherDevice {
|
|
247
|
+
startScanTimer = Timer.scheduledTimer(timeInterval: 20,
|
|
248
|
+
target: self,
|
|
249
|
+
selector: #selector(startScan),
|
|
250
|
+
userInfo: nil,
|
|
251
|
+
repeats: false)
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
case .sensorLostPower:
|
|
255
|
+
sensorLostPower()
|
|
256
|
+
|
|
257
|
+
case .updateBindWatchSuccess:
|
|
258
|
+
//KLTLaunchConfiguration.sharedManager.bindSuccessRootViewController()
|
|
259
|
+
print("Success done")
|
|
260
|
+
default:
|
|
261
|
+
break
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
func sensorLostPower() {
|
|
265
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
|
266
|
+
// Will trigger `BluetoothManagerStatusDisconnected` due to forced disconnection
|
|
267
|
+
self.manager.forceEndBleSensor()
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@objc func startScan() {
|
|
272
|
+
manager.startScan()
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
func endBleSensorCycle() {
|
|
276
|
+
if let timer = countdownTimer {
|
|
277
|
+
timer.invalidate()
|
|
278
|
+
countdownTimer = nil
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
removeAllObservers()
|
|
282
|
+
|
|
283
|
+
print("initial State all end")
|
|
284
|
+
// KLTLaunchConfiguration.sharedManager.resetRootViewController(.beforeUse)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
struct KLTDateFormatter {
|
|
293
|
+
static let shared = KLTDateFormatter()
|
|
294
|
+
|
|
295
|
+
private let calendar = Calendar(identifier: .gregorian)
|
|
296
|
+
private let locale = Locale(identifier: "en_GB")
|
|
297
|
+
|
|
298
|
+
private func configuredFormatter(withFormat format: String, timeZone: TimeZone? = nil) -> DateFormatter {
|
|
299
|
+
let formatter = DateFormatter()
|
|
300
|
+
formatter.calendar = calendar
|
|
301
|
+
formatter.locale = locale
|
|
302
|
+
formatter.dateFormat = format
|
|
303
|
+
if let tz = timeZone {
|
|
304
|
+
formatter.timeZone = tz
|
|
305
|
+
}
|
|
306
|
+
return formatter
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
func getWholeString(from date: Date) -> String {
|
|
310
|
+
return configuredFormatter(withFormat: "yyyy-MM-dd HH:mm:ss").string(from: date)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
func getDayString(from date: Date) -> String {
|
|
314
|
+
return configuredFormatter(withFormat: "MM-dd").string(from: date)
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
func getHourString(from date: Date) -> String {
|
|
318
|
+
let hour = configuredFormatter(withFormat: "HH").string(from: date)
|
|
319
|
+
return "\(hour):00"
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
func getMinuteString(from date: Date) -> String {
|
|
323
|
+
return configuredFormatter(withFormat: "HH:mm").string(from: date)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
func getMinuteDate(from string: String) -> Date? {
|
|
327
|
+
return configuredFormatter(withFormat: "HH:mm").date(from: string)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
func getHourDate(from string: String) -> Date? {
|
|
331
|
+
return configuredFormatter(withFormat: "HH:00").date(from: string)
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
func getDayDate(from string: String) -> Date? {
|
|
335
|
+
return configuredFormatter(withFormat: "MM-dd").date(from: string)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
func getDateTime(from string: String) -> Date? {
|
|
339
|
+
return configuredFormatter(withFormat: "yyyy-MM-dd HH:mm").date(from: string)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
func getDateFromWholeString(_ string: String) -> Date? {
|
|
343
|
+
return configuredFormatter(withFormat: "yyyy-MM-dd HH:mm:ss").date(from: string)
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
func getUTCFormatDate(from localDate: String) -> String? {
|
|
347
|
+
guard let date = getDateFromWholeString(localDate) else { return nil }
|
|
348
|
+
return configuredFormatter(withFormat: "yyyy-MM-dd HH:mm:ss", timeZone: TimeZone(abbreviation: "UTC")).string(from: date)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
func getLocalFromUTC(_ utc: String) -> String? {
|
|
352
|
+
let formatter = configuredFormatter(withFormat: "yyyy-MM-dd HH:mm:ss", timeZone: TimeZone.current)
|
|
353
|
+
guard let date = formatter.date(from: utc) else { return nil }
|
|
354
|
+
return getWholeString(from: date)
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
extension String {
|
|
358
|
+
func klt_contains(_ other: String) -> Bool {
|
|
359
|
+
return self.range(of: other) != nil
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
func klt_hasValidTransmit() -> Bool {
|
|
363
|
+
guard self.count >= 2 else { return false }
|
|
364
|
+
let lastHex = String(self.suffix(2))
|
|
365
|
+
return lastHex == "00"
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
func reverseToString(groupSize: Int) -> String {
|
|
369
|
+
guard groupSize > 0 && self.count > groupSize else { return self }
|
|
370
|
+
|
|
371
|
+
var result = ""
|
|
372
|
+
var index = self.count
|
|
373
|
+
|
|
374
|
+
while index >= groupSize {
|
|
375
|
+
let start = self.index(self.startIndex, offsetBy: index - groupSize)
|
|
376
|
+
let end = self.index(self.startIndex, offsetBy: index)
|
|
377
|
+
result += self[start..<end]
|
|
378
|
+
index -= groupSize
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if index > 0 {
|
|
382
|
+
let leftover = self.prefix(index)
|
|
383
|
+
result += leftover
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return result
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
static func getTimeString(with count: Int) -> String {
|
|
390
|
+
let hours = String(format: "%02d", count / 3600)
|
|
391
|
+
let minutes = String(format: "%02d", (count % 3600) / 60)
|
|
392
|
+
let seconds = String(format: "%02d", count % 60)
|
|
393
|
+
return "\(hours):\(minutes):\(seconds)"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
@@ -11,8 +11,7 @@ var _Matrics = _interopRequireDefault(require("./helpers/Matrics"));
|
|
|
11
11
|
var _bluetoothPermissionHelper = require("./helpers/bluetoothPermissionHelper");
|
|
12
12
|
var _reactNativePermissions = require("react-native-permissions");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
const DeviceList = [{
|
|
17
16
|
// image: Images.GoodFlipBcaDevice,
|
|
18
17
|
device_type: 'GoodFlip',
|
|
@@ -44,7 +43,7 @@ const BcaDeviceListSheet = ({
|
|
|
44
43
|
const [devices, setDevices] = (0, _react.useState)([]);
|
|
45
44
|
const [closeOnTouchBackdrop, setCloseOnTouchBackdrop] = (0, _react.useState)(false);
|
|
46
45
|
const [bluetoothIsEnable, setBluetoothIsEnable] = (0, _react.useState)(false);
|
|
47
|
-
const [selectedDevice, setSelectedDevice] = (0, _react.useState)(
|
|
46
|
+
const [selectedDevice, setSelectedDevice] = (0, _react.useState)(null);
|
|
48
47
|
const actionSheetRef = (0, _react.useRef)(null);
|
|
49
48
|
(0, _react.useEffect)(() => {
|
|
50
49
|
checkBleEnable();
|
|
@@ -95,7 +94,7 @@ const BcaDeviceListSheet = ({
|
|
|
95
94
|
const renderRightContainer = (0, _react.useCallback)(() => {
|
|
96
95
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
97
96
|
style: [styles.rightContainer, {
|
|
98
|
-
paddingLeft: _Matrics.default.s((devices
|
|
97
|
+
paddingLeft: _Matrics.default.s((devices !== null && devices !== void 0 ? devices : []).length ? 15 : 0)
|
|
99
98
|
}]
|
|
100
99
|
}, renderStep2Container());
|
|
101
100
|
}, [selectedDevice, bluetoothIsEnable, devices]);
|
|
@@ -120,7 +119,9 @@ const BcaDeviceListSheet = ({
|
|
|
120
119
|
const renderBottomBtn = (0, _react.useCallback)(() => {
|
|
121
120
|
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
122
121
|
onPress: () => {
|
|
123
|
-
|
|
122
|
+
if (selectedDevice) {
|
|
123
|
+
onPressConnectSmartScaleBtn(selectedDevice);
|
|
124
|
+
}
|
|
124
125
|
},
|
|
125
126
|
activeOpacity: 0.8,
|
|
126
127
|
disabled: !bluetoothIsEnable || !selectedDevice,
|
|
@@ -130,7 +131,7 @@ const BcaDeviceListSheet = ({
|
|
|
130
131
|
}]
|
|
131
132
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
132
133
|
style: styles.connectWithSmartScaleTxt
|
|
133
|
-
}, "Connect With Smart
|
|
134
|
+
}, "Connect With Smart Scale"));
|
|
134
135
|
}, [selectedDevice, bluetoothIsEnable]);
|
|
135
136
|
return /*#__PURE__*/_react.default.createElement(_reactNativeActionsSheet.default, {
|
|
136
137
|
id: sheetId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeActionsSheet","_interopRequireDefault","_Matrics","_bluetoothPermissionHelper","_reactNativePermissions","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DeviceList","device_type","title","colors","gun_powder","mountain_meadow","solitude","royal_blue_goodflip","alice_blue","auro_metal_saurus","anti_flash_white","illuminating_emerald","aero_blue","honeydew","sea_green","dark_jungle_green","cosmic_cobalt","brunswick_green","BcaDeviceListSheet","sheetId","payload","onPressConnectSmartScaleBtn","devices","setDevices","useState","closeOnTouchBackdrop","setCloseOnTouchBackdrop","bluetoothIsEnable","setBluetoothIsEnable","selectedDevice","setSelectedDevice","actionSheetRef","useRef","useEffect","checkBleEnable","checkDeviceIsAvailable","onChange","position","tempDevideList","push","permission","checkBluetoothPermission","status","RESULTS","GRANTED","onPressSwitch","value","managePermission","renderHeader","useCallback","createElement","View","style","styles","headerContainer","Text","syncSmartScaleTxt","TouchableOpacity","activeOpacity","onPress","_actionSheetRef$curre","current","hide","renderRightContainer","rightContainer","paddingLeft","Matrics","s","length","renderStep2Container","inOrderToConnectTxt","switchButtonContainer","turnOnBluetoothTxt","Switch","trackColor","false","true","thumbColor","ios_backgroundColor","onValueChange","renderBottomBtn","disabled","connectWithSmartSmartScaleButtonContainer","backgroundColor","shadowColor","connectWithSmartScaleTxt","id","ref","containerStyle","sheet","isModal","snapPoints","initialSnapIndex","useBottomSafeAreaPadding","Platform","OS","gestureEnabled","drawUnderStatusBar","defaultOverlayOpacity","smallHeight","mainContainer","flexDirection","_default","exports","StyleSheet","create","borderTopRightRadius","borderTopLeftRadius","paddingBottom","vs","paddingHorizontal","paddingVertical","marginBottom","alignItems","justifyContent","fontSize","mvs","color","mainStepContainer","borderRadius","overflow","gradientContainer","height","stepContainer","width","marginHorizontal","flex","step1Container","gap","stepHeaderTxt","selectYourSmartScaleTxt","deviceItemContainer","borderWidth","deviceItemDetailsContainer","deviceImageContainer","resizeMode","deviceNameTxt","borderColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../src","sources":["BcaDeviceListSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAC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AAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD1C,kBAAkB,EAAE;IAClB;IACA2C,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzBC,KAAK,EAAE;EACT,CAAC;EACDnC,yCAAyC,EAAE;IACzCmB,aAAa,EAAE,KAAK;IACpBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IAExBK,YAAY,EAAErD,gBAAO,CAACkD,GAAG,CAAC,CAAC,CAAC;IAC5BL,eAAe,EAAE7C,gBAAO,CAAC2C,EAAE,CAAC,EAAE,CAAC;IAC/B6B,YAAY,EAAE;MAAEhB,MAAM,EAAE,EAAE;MAAEE,KAAK,EAAE;IAAE,CAAC;IACtCe,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,CAAC;IACfZ,GAAG,EAAE,EAAE;IACPa,SAAS,EAAE;EACb,CAAC;EACDxD,wBAAwB,EAAE;IACxB8B,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzB;IACAC,KAAK,EAAE;EACT,CAAC;EACD/C,mBAAmB,EAAE;IACnB;IACA6C,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzBC,KAAK,EAAE,SAAS;IAChBL,YAAY,EAAE9C,gBAAO,CAAC2C,EAAE,CAAC,EAAE;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeActionsSheet","_interopRequireDefault","_Matrics","_bluetoothPermissionHelper","_reactNativePermissions","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DeviceList","device_type","title","colors","gun_powder","mountain_meadow","solitude","royal_blue_goodflip","alice_blue","auro_metal_saurus","anti_flash_white","illuminating_emerald","aero_blue","honeydew","sea_green","dark_jungle_green","cosmic_cobalt","brunswick_green","BcaDeviceListSheet","sheetId","payload","onPressConnectSmartScaleBtn","devices","setDevices","useState","closeOnTouchBackdrop","setCloseOnTouchBackdrop","bluetoothIsEnable","setBluetoothIsEnable","selectedDevice","setSelectedDevice","actionSheetRef","useRef","useEffect","checkBleEnable","checkDeviceIsAvailable","onChange","position","tempDevideList","push","permission","checkBluetoothPermission","status","RESULTS","GRANTED","onPressSwitch","value","managePermission","renderHeader","useCallback","createElement","View","style","styles","headerContainer","Text","syncSmartScaleTxt","TouchableOpacity","activeOpacity","onPress","_actionSheetRef$curre","current","hide","renderRightContainer","rightContainer","paddingLeft","Matrics","s","length","renderStep2Container","inOrderToConnectTxt","switchButtonContainer","turnOnBluetoothTxt","Switch","trackColor","false","true","thumbColor","ios_backgroundColor","onValueChange","renderBottomBtn","disabled","connectWithSmartSmartScaleButtonContainer","backgroundColor","shadowColor","connectWithSmartScaleTxt","id","ref","containerStyle","sheet","isModal","snapPoints","initialSnapIndex","useBottomSafeAreaPadding","Platform","OS","gestureEnabled","drawUnderStatusBar","defaultOverlayOpacity","smallHeight","mainContainer","flexDirection","_default","exports","StyleSheet","create","borderTopRightRadius","borderTopLeftRadius","paddingBottom","vs","paddingHorizontal","paddingVertical","marginBottom","alignItems","justifyContent","fontSize","mvs","color","mainStepContainer","borderRadius","overflow","gradientContainer","height","stepContainer","width","marginHorizontal","flex","step1Container","gap","stepHeaderTxt","selectYourSmartScaleTxt","deviceItemContainer","borderWidth","deviceItemDetailsContainer","deviceImageContainer","resizeMode","deviceNameTxt","borderColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sources":["BcaDeviceListSheet.tsx"],"sourcesContent":["import {\n Alert,\n Image,\n Platform,\n StyleSheet,\n Switch,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport React, { useCallback, useEffect, useState, useRef } from 'react';\nimport ActionSheet from 'react-native-actions-sheet';\nimport Matrics from './helpers/Matrics';\nimport {\n checkBluetoothPermission,\n managePermission,\n} from './helpers/bluetoothPermissionHelper';\nimport { RESULTS } from 'react-native-permissions';\n\ninterface Device {\n device_type: string;\n title: string;\n}\n\nconst DeviceList: Device[] = [\n {\n // image: Images.GoodFlipBcaDevice,\n device_type: 'GoodFlip',\n title: 'GoodFlip device',\n },\n];\n\nconst colors = {\n gun_powder: '#49454F',\n mountain_meadow: '#12B76A',\n solitude: '#E4E7EC',\n royal_blue_goodflip: '#444CE7',\n alice_blue: '#EEF4FF',\n auro_metal_saurus: '#667085',\n anti_flash_white: '#F2F4F7',\n illuminating_emerald: '#299D6B',\n aero_blue: '#CBF0E0',\n honeydew: '#E6FAF1',\n sea_green: '#2A805A',\n dark_jungle_green: '#101828',\n cosmic_cobalt: '#2D3282',\n brunswick_green: '#1D4D38',\n};\n\nconst BcaDeviceListSheet = ({ sheetId, payload }: {\n sheetId: string;\n payload: {\n onPressConnectSmartScaleBtn: (deviceType: Device) => void;\n };\n}) => {\n const { onPressConnectSmartScaleBtn } = payload;\n\n const [devices, setDevices] = useState<Device[]>([]);\n const [closeOnTouchBackdrop, setCloseOnTouchBackdrop] = useState(false);\n const [bluetoothIsEnable, setBluetoothIsEnable] = useState(false);\n const [selectedDevice, setSelectedDevice] = useState<Device | null>(null);\n const actionSheetRef = useRef<any>(null);\n\n useEffect(() => {\n checkBleEnable();\n // handlePageViewEvent(Constants.SCREEN_NAME.BCABluetoothToggle);\n }, []);\n\n useEffect(() => {\n checkDeviceIsAvailable();\n }, []);\n\n const onChange = (position: number) => {\n if (position == 0) {\n setCloseOnTouchBackdrop(true);\n }\n };\n\n const checkDeviceIsAvailable = () => {\n const tempDevideList: Device[] = [];\n tempDevideList.push(DeviceList[0]);\n setDevices(tempDevideList);\n };\n\n const checkBleEnable = async () => {\n const permission = await checkBluetoothPermission();\n if (permission.status !== RESULTS.GRANTED) {\n setBluetoothIsEnable(false);\n }\n };\n\n const onPressSwitch = async (value) => {\n if (value) {\n const permission = await checkBluetoothPermission();\n await managePermission(permission, value, () => {\n setBluetoothIsEnable(true);\n });\n } else {\n setBluetoothIsEnable(false);\n }\n };\n\n const renderHeader = useCallback(() => {\n return (\n <View style={styles.headerContainer}>\n <Text style={styles.syncSmartScaleTxt}>Sync Smart Scale</Text>\n <TouchableOpacity\n activeOpacity={0.8}\n onPress={() => actionSheetRef.current?.hide()}\n >\n {/* Remove or properly implement the icon component */}\n </TouchableOpacity>\n </View>\n );\n }, []);\n\n const renderRightContainer = useCallback(() => {\n return (\n <View\n style={[\n styles.rightContainer,\n {\n paddingLeft: Matrics.s((devices ?? []).length ? 15 : 0),\n },\n ]}\n >\n {renderStep2Container()}\n </View>\n );\n }, [selectedDevice, bluetoothIsEnable, devices]);\n\n const renderStep2Container = useCallback(() => {\n return (\n <View>\n <Text style={styles.inOrderToConnectTxt}>\n In order to connect with the GoodFlip smart scale, you need to turn on\n the Bluetooth on your device\n </Text>\n\n <View style={styles.switchButtonContainer}>\n <Text style={styles.turnOnBluetoothTxt}>Turn on Bluetooth</Text>\n <Switch\n trackColor={{\n false: '#F2F4F7',\n true: '#299D6B',\n }}\n thumbColor={'white'}\n ios_backgroundColor={'#F2F4F7'}\n onValueChange={onPressSwitch}\n value={bluetoothIsEnable}\n />\n </View>\n </View>\n );\n }, [bluetoothIsEnable, devices]);\n\n const renderBottomBtn = useCallback(() => {\n return (\n <TouchableOpacity\n onPress={() => {\n if (selectedDevice) {\n onPressConnectSmartScaleBtn(selectedDevice);\n }\n }}\n activeOpacity={0.8}\n disabled={!bluetoothIsEnable || !selectedDevice}\n style={[\n styles.connectWithSmartSmartScaleButtonContainer,\n {\n backgroundColor:\n !bluetoothIsEnable || !selectedDevice\n ? colors.aero_blue\n : colors.illuminating_emerald,\n shadowColor:\n !bluetoothIsEnable || !selectedDevice\n ? colors.honeydew\n : colors.sea_green,\n },\n ]}\n >\n <Text style={styles.connectWithSmartScaleTxt}>\n Connect With Smart Scale\n </Text>\n </TouchableOpacity>\n );\n }, [selectedDevice, bluetoothIsEnable]);\n\n return (\n <ActionSheet\n id={sheetId}\n ref={actionSheetRef}\n containerStyle={styles.sheet}\n onChange={onChange}\n isModal={true}\n snapPoints={[100]}\n initialSnapIndex={0}\n useBottomSafeAreaPadding={\n Platform.OS === 'ios' ? !closeOnTouchBackdrop : true\n }\n gestureEnabled={false}\n drawUnderStatusBar={false}\n defaultOverlayOpacity={0.3}\n closeOnTouchBackdrop={closeOnTouchBackdrop}\n >\n <View style={styles.smallHeight}>\n <View style={styles.mainContainer}>\n {renderHeader()}\n <View style={{ flexDirection: 'row' }}>{renderRightContainer()}</View>\n </View>\n {renderBottomBtn()}\n </View>\n </ActionSheet>\n );\n};\n\nexport default BcaDeviceListSheet;\n\nconst styles = StyleSheet.create({\n sheet: {\n borderTopRightRadius: 20,\n borderTopLeftRadius: 20,\n paddingBottom: Matrics.vs(Platform.OS === 'android' ? 20 : 5),\n },\n smallHeight: {\n paddingHorizontal: Matrics.s(15),\n paddingVertical: Matrics.s(15),\n },\n mainContainer: {\n marginBottom: Matrics.vs(40),\n },\n headerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: Matrics.vs(20),\n },\n syncSmartScaleTxt: {\n // fontFamily: Fonts.ROBOTO_SEMI_BOLD,\n fontSize: Matrics.mvs(18),\n color: '#101828',\n },\n mainStepContainer: {\n backgroundColor: 'E4E7EC',\n borderRadius: Matrics.mvs(100),\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: Matrics.vs(15),\n overflow: 'hidden',\n },\n gradientContainer: {\n height: Matrics.vs(30),\n alignItems: 'center',\n },\n stepContainer: {\n height: Matrics.mvs(14),\n width: Matrics.mvs(14),\n backgroundColor: 'white',\n borderRadius: Matrics.mvs(100),\n marginHorizontal: Matrics.s(1),\n },\n rightContainer: {\n flex: 1,\n paddingLeft: Matrics.s(15),\n },\n step1Container: {\n gap: 15,\n paddingBottom: Matrics.vs(30),\n },\n stepHeaderTxt: {\n // fontFamily: Fonts.ROBOTO_REGULAR,\n fontSize: Matrics.mvs(12),\n color: '#101828',\n },\n selectYourSmartScaleTxt: {\n // fontFamily: Fonts.ROBOTO_SEMI_BOLD,\n fontSize: Matrics.mvs(16),\n color: '#101828',\n },\n deviceItemContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderWidth: 1,\n borderRadius: Matrics.mvs(8),\n paddingVertical: Matrics.vs(10),\n paddingHorizontal: Matrics.s(13),\n },\n deviceItemDetailsContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 15,\n },\n deviceImageContainer: {\n height: Matrics.mvs(50),\n width: Matrics.mvs(50),\n resizeMode: 'contain',\n },\n deviceNameTxt: {\n // fontFamily: Fonts.ROBOTO_BOLD,\n fontSize: Matrics.mvs(16),\n color: '#101828',\n },\n switchButtonContainer: {\n borderWidth: 1,\n borderRadius: Matrics.mvs(16),\n paddingVertical: Matrics.vs(10),\n paddingHorizontal: Matrics.s(13),\n borderColor: '#E4E7EC',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n turnOnBluetoothTxt: {\n // fontFamily: Fonts.ROBOTO_SEMI_BOLD,\n fontSize: Matrics.mvs(16),\n color: '#2D3282',\n },\n connectWithSmartSmartScaleButtonContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n\n borderRadius: Matrics.mvs(8),\n paddingVertical: Matrics.vs(15),\n shadowOffset: { height: 12, width: 0 },\n shadowOpacity: 1,\n shadowRadius: 1,\n gap: 15,\n elevation: 8,\n },\n connectWithSmartScaleTxt: {\n fontSize: Matrics.mvs(16),\n // fontFamily: Fonts.ROBOTO_BOLD,\n color: 'white',\n },\n inOrderToConnectTxt: {\n // fontFamily: Fonts.ROBOTO_REGULAR,\n fontSize: Matrics.mvs(14),\n color: '#667085',\n marginBottom: Matrics.vs(25),\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,wBAAA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AAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD1C,kBAAkB,EAAE;IAClB;IACA2C,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzBC,KAAK,EAAE;EACT,CAAC;EACDnC,yCAAyC,EAAE;IACzCmB,aAAa,EAAE,KAAK;IACpBY,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IAExBK,YAAY,EAAErD,gBAAO,CAACkD,GAAG,CAAC,CAAC,CAAC;IAC5BL,eAAe,EAAE7C,gBAAO,CAAC2C,EAAE,CAAC,EAAE,CAAC;IAC/B6B,YAAY,EAAE;MAAEhB,MAAM,EAAE,EAAE;MAAEE,KAAK,EAAE;IAAE,CAAC;IACtCe,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,CAAC;IACfZ,GAAG,EAAE,EAAE;IACPa,SAAS,EAAE;EACb,CAAC;EACDxD,wBAAwB,EAAE;IACxB8B,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzB;IACAC,KAAK,EAAE;EACT,CAAC;EACD/C,mBAAmB,EAAE;IACnB;IACA6C,QAAQ,EAAEjD,gBAAO,CAACkD,GAAG,CAAC,EAAE,CAAC;IACzBC,KAAK,EAAE,SAAS;IAChBL,YAAY,EAAE9C,gBAAO,CAAC2C,EAAE,CAAC,EAAE;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.helpCGM = void 0;
|
|
7
|
+
exports.initializeCGMEventListener = initializeCGMEventListener;
|
|
8
|
+
exports.reconnectCGM = exports.observeAllGlucoseDataHandler = void 0;
|
|
9
|
+
exports.removeCGMEventListener = removeCGMEventListener;
|
|
10
|
+
exports.stopCGM = exports.startCGM = void 0;
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
const {
|
|
13
|
+
CgmTrackyLib,
|
|
14
|
+
observeAllGlucoseData
|
|
15
|
+
} = _reactNative.NativeModules;
|
|
16
|
+
const iosEventEmitter = new _reactNative.NativeEventEmitter(CgmTrackyLib);
|
|
17
|
+
let eventSubscription = null;
|
|
18
|
+
function initializeCGMEventListener(callback) {
|
|
19
|
+
if (eventSubscription) {
|
|
20
|
+
eventSubscription.remove();
|
|
21
|
+
}
|
|
22
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
23
|
+
eventSubscription = _reactNative.DeviceEventEmitter.addListener('cgmDeviceEvent', eventData => {
|
|
24
|
+
const {
|
|
25
|
+
status
|
|
26
|
+
} = eventData;
|
|
27
|
+
if (status === 'WARM_PERIOD_STARTED') {
|
|
28
|
+
callback(eventData);
|
|
29
|
+
} else {
|
|
30
|
+
callback(eventData);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
} else if (_reactNative.Platform.OS === 'ios' && iosEventEmitter) {
|
|
34
|
+
eventSubscription = iosEventEmitter.addListener('cgmDeviceEvent', eventData => {
|
|
35
|
+
const {
|
|
36
|
+
status
|
|
37
|
+
} = eventData;
|
|
38
|
+
if (status === 'WARM_PERIOD_STARTED') {
|
|
39
|
+
callback(eventData);
|
|
40
|
+
} else {
|
|
41
|
+
callback(eventData);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function removeCGMEventListener() {
|
|
47
|
+
if (eventSubscription) {
|
|
48
|
+
eventSubscription.remove();
|
|
49
|
+
eventSubscription = null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const LINKING_ERROR = `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
53
|
+
ios: "- You have run 'pod install'\n",
|
|
54
|
+
default: ''
|
|
55
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
56
|
+
const cgmLib = _reactNative.NativeModules.CgmTrackyLib ? _reactNative.NativeModules.CgmTrackyLib : new Proxy({}, {
|
|
57
|
+
get() {
|
|
58
|
+
throw new Error(LINKING_ERROR);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const startCGM = async token => {
|
|
62
|
+
console.log('token====startCGM', token);
|
|
63
|
+
try {
|
|
64
|
+
const result = await cgmLib.startCgmTracky(token);
|
|
65
|
+
console.log(result);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error(error);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.startCGM = startCGM;
|
|
71
|
+
const reconnectCGM = async token => {
|
|
72
|
+
console.log('reconnectCGM====');
|
|
73
|
+
try {
|
|
74
|
+
const result = await cgmLib.reconnectCgmTracky(token);
|
|
75
|
+
console.log(result);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(error);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.reconnectCGM = reconnectCGM;
|
|
81
|
+
const observeAllGlucoseDataHandler = async token => {
|
|
82
|
+
console.log('observeAllGlucoseDataHandler====');
|
|
83
|
+
try {
|
|
84
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
85
|
+
const deviceStatus = await cgmLib.observeDeviceStatus(token);
|
|
86
|
+
console.log(result);
|
|
87
|
+
console.log(deviceStatus);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.log('error====', error);
|
|
90
|
+
console.error(error);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
exports.observeAllGlucoseDataHandler = observeAllGlucoseDataHandler;
|
|
94
|
+
const helpCGM = async token => {
|
|
95
|
+
console.log('helpCGM====');
|
|
96
|
+
try {
|
|
97
|
+
const result = await cgmLib.openHelpSupport();
|
|
98
|
+
console.log(result);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error(error);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.helpCGM = helpCGM;
|
|
104
|
+
const stopCGM = async () => {
|
|
105
|
+
// Implementation
|
|
106
|
+
};
|
|
107
|
+
exports.stopCGM = stopCGM;
|
|
108
|
+
//# sourceMappingURL=CGMConnect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","CgmTrackyLib","observeAllGlucoseData","NativeModules","iosEventEmitter","NativeEventEmitter","eventSubscription","initializeCGMEventListener","callback","remove","Platform","OS","DeviceEventEmitter","addListener","eventData","status","removeCGMEventListener","LINKING_ERROR","select","ios","default","cgmLib","Proxy","get","Error","startCGM","token","console","log","result","startCgmTracky","error","exports","reconnectCGM","reconnectCgmTracky","observeAllGlucoseDataHandler","deviceStatus","observeDeviceStatus","helpCGM","openHelpSupport","stopCGM"],"sources":["CGMConnect.ts"],"sourcesContent":["import { DeviceEventEmitter, EmitterSubscription, NativeEventEmitter, NativeModules, Platform } from \"react-native\";\n\nconst { CgmTrackyLib, observeAllGlucoseData } = NativeModules;\n\nconst iosEventEmitter = new NativeEventEmitter(CgmTrackyLib);\n\nlet eventSubscription: EmitterSubscription | null = null;\n\n\nfunction initializeCGMEventListener(\n callback: (eventData: any) => void\n) {\n if (eventSubscription) {\n eventSubscription.remove();\n }\n\n if (Platform.OS === 'android') {\n eventSubscription = DeviceEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n } else if (Platform.OS === 'ios' && iosEventEmitter) {\n eventSubscription = iosEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n }\n}\n\nfunction removeCGMEventListener() {\n if (eventSubscription) {\n eventSubscription.remove();\n eventSubscription = null;\n }\n}\n\nconst LINKING_ERROR =\n `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst cgmLib = NativeModules.CgmTrackyLib\n ? NativeModules.CgmTrackyLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n\nconst startCGM = async (token: string) => {\n console.log('token====startCGM', token);\n try {\n const result = await cgmLib.startCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const reconnectCGM = async (token: string) => {\n console.log('reconnectCGM====');\n try {\n const result = await cgmLib.reconnectCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const observeAllGlucoseDataHandler = async (token: string) => {\n console.log('observeAllGlucoseDataHandler====');\n try {\n const result = await cgmLib.observeAllGlucoseData(token);\n const deviceStatus = await cgmLib.observeDeviceStatus(token);\n console.log(result);\n console.log(deviceStatus);\n } catch (error) {\n console.log('error====', error);\n console.error(error);\n }\n };\n\nconst helpCGM = async (token: string) => {\n console.log('helpCGM====');\n try {\n const result = await cgmLib.openHelpSupport();\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n};\n\n\n\nconst stopCGM = async () => {\n // Implementation\n};\n\nexport { startCGM, stopCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM };"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC,YAAY;EAAEC;AAAsB,CAAC,GAAGC,0BAAa;AAE7D,MAAMC,eAAe,GAAG,IAAIC,+BAAkB,CAACJ,YAAY,CAAC;AAE5D,IAAIK,iBAA6C,GAAG,IAAI;AAGxD,SAASC,0BAA0BA,CACjCC,QAAkC,EAClC;EACA,IAAIF,iBAAiB,EAAE;IACrBA,iBAAiB,CAACG,MAAM,CAAC,CAAC;EAC5B;EAEA,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,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