From 94658225aa0d33cd87af3177679e9e8029697ef6 Mon Sep 17 00:00:00 2001 From: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Date: Tue, 23 May 2023 11:49:06 +0530 Subject: [PATCH] feat(84): [Pooja|Tilak] remove bluetooth enabled check --- .env | 1 - lib/smartshare/index.ts | 11 +-------- machines/openIdBle/scan/scanMachine.ts | 7 +----- screens/Profile/AppMetaData.tsx | 1 - screens/Request/ReceiveVcScreen.tsx | 33 ++------------------------ screens/Request/RequestLayout.tsx | 3 +-- types/react-native-dotenv/index.d.ts | 5 ---- 7 files changed, 5 insertions(+), 56 deletions(-) diff --git a/.env b/.env index d58987cb..bf45192a 100644 --- a/.env +++ b/.env @@ -7,4 +7,3 @@ GOOGLE_NEARBY_MESSAGES_API_KEY= #Application Theme can be ( orange | purple ) APPLICATION_THEME=orange -USE_BLE_SHARE=true diff --git a/lib/smartshare/index.ts b/lib/smartshare/index.ts index ae3cffb9..778e3d7f 100644 --- a/lib/smartshare/index.ts +++ b/lib/smartshare/index.ts @@ -2,20 +2,11 @@ import SmartshareReactNative from '@idpass/smartshare-react-native'; import OpenIdBle from 'react-native-openid4vp-ble'; import { OpenIDBLEShare } from 'react-native-openid4vp-ble/lib/typescript/types/bleshare'; import { IdpassSmartshare as IdpassSmartshareType } from '@idpass/smartshare-react-native/lib/typescript/IdpassSmartshare'; -import { USE_BLE_SHARE } from 'react-native-dotenv'; -const { IdpassSmartshare } = SmartshareReactNative; const { Openid4vpBle } = OpenIdBle; type ShareProtocol = OpenIDBLEShare | IdpassSmartshareType; let ShareLib: ShareProtocol; -export const isBLEEnabled = USE_BLE_SHARE === 'true'; -export const isGoogleNearbyEnabled = !isBLEEnabled; - -if (isBLEEnabled) { - ShareLib = Openid4vpBle; -} else { - ShareLib = IdpassSmartshare; -} +ShareLib = Openid4vpBle; export default ShareLib; diff --git a/machines/openIdBle/scan/scanMachine.ts b/machines/openIdBle/scan/scanMachine.ts index 425094dc..a771c88a 100644 --- a/machines/openIdBle/scan/scanMachine.ts +++ b/machines/openIdBle/scan/scanMachine.ts @@ -31,7 +31,6 @@ import { import { checkLocation, requestLocation } from '../../../shared/location'; import { CameraCapturedPicture } from 'expo-camera'; import { log } from 'xstate/lib/actions'; -import { isBLEEnabled } from '../../../lib/smartshare'; import { createQrLoginMachine, qrLoginMachine } from '../../QrLoginMachine'; import { StoreEvents } from '../../store'; import { @@ -812,11 +811,7 @@ export const scanMachine = guards: { isOpenIdQr: (_context, event) => { // don't scan if QR is offline and Google Nearby is enabled - if ( - Platform.OS === 'ios' && - !isBLEEnabled && - !event.params.includes('OPENID4VP://') - ) + if (Platform.OS === 'ios' && !event.params.includes('OPENID4VP://')) return false; const param: ConnectionParams = Object.create(null); diff --git a/screens/Profile/AppMetaData.tsx b/screens/Profile/AppMetaData.tsx index 6fee2aa2..f03962ce 100644 --- a/screens/Profile/AppMetaData.tsx +++ b/screens/Profile/AppMetaData.tsx @@ -8,7 +8,6 @@ import { Button, Text, Row, Column } from '../../components/ui'; import { Theme } from '../../components/ui/styleUtils'; import appMetaData from '../../AppMetaData.md'; import { getVersion } from 'react-native-device-info'; -import { isBLEEnabled } from '../../lib/smartshare'; export const AppMetaData: React.FC = (props) => { const { t } = useTranslation('AppMetaData'); diff --git a/screens/Request/ReceiveVcScreen.tsx b/screens/Request/ReceiveVcScreen.tsx index 43052d76..fef5bb93 100644 --- a/screens/Request/ReceiveVcScreen.tsx +++ b/screens/Request/ReceiveVcScreen.tsx @@ -8,7 +8,6 @@ import { VcDetails } from '../../components/VcDetails'; import { useReceiveVcScreen } from './ReceiveVcScreenController'; import { VerifyIdentityOverlay } from '../VerifyIdentityOverlay'; import { MessageOverlay } from '../../components/MessageOverlay'; -import { isBLEEnabled } from '../../lib/smartshare'; import { useOverlayVisibleAfterTimeout } from '../../shared/hooks/useOverlayVisibleAfterTimeout'; export const ReceiveVcScreen: React.FC = () => { @@ -43,35 +42,7 @@ export const ReceiveVcScreen: React.FC = () => { /> - {!isBLEEnabled ? ( - <> - {controller.incomingVc.shouldVerifyPresence ? ( -