From d1d775228e2483487d254448202330119fa2f915 Mon Sep 17 00:00:00 2001 From: Paolo Miguel de Leon Date: Fri, 15 Jul 2022 14:48:25 +0800 Subject: [PATCH] fix: restore smartshare library --- ios/MOSIPResidentApp.xcodeproj/project.pbxproj | 6 +++--- ios/Podfile | 3 +++ machines/request.ts | 3 +-- machines/scan.ts | 3 +-- package-lock.json | 16 +++++++++++++++- package.json | 4 ++-- types/idpass__smartshare-react-native/index.d.ts | 4 ++-- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ios/MOSIPResidentApp.xcodeproj/project.pbxproj b/ios/MOSIPResidentApp.xcodeproj/project.pbxproj index ceec9b04..249d634d 100644 --- a/ios/MOSIPResidentApp.xcodeproj/project.pbxproj +++ b/ios/MOSIPResidentApp.xcodeproj/project.pbxproj @@ -171,7 +171,7 @@ LastUpgradeCheck = 1130; TargetAttributes = { 13B07F861A680F5B00A75B9A = { - DevelopmentTeam = YAYFZ487SD; + DevelopmentTeam = YFF595NUCX; LastSwiftMigration = 1250; }; }; @@ -342,7 +342,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = MOSIPResidentApp/MOSIPResidentApp.entitlements; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = YAYFZ487SD; + DEVELOPMENT_TEAM = YFF595NUCX; ENABLE_BITCODE = NO; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -374,7 +374,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = MOSIPResidentApp/MOSIPResidentApp.entitlements; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = YAYFZ487SD; + DEVELOPMENT_TEAM = YFF595NUCX; INFOPLIST_FILE = MOSIPResidentApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/ios/Podfile b/ios/Podfile index 9408399c..09b7b1c8 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -52,6 +52,9 @@ target 'MOSIPResidentApp' do end end end + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' + end end end diff --git a/machines/request.ts b/machines/request.ts index be661fe1..8c78e655 100644 --- a/machines/request.ts +++ b/machines/request.ts @@ -1,5 +1,4 @@ -// import SmartShare from '@idpass/smartshare-react-native'; -const SmartShare = {}; +import SmartShare from '@idpass/smartshare-react-native'; import BluetoothStateManager from 'react-native-bluetooth-state-manager'; import { EmitterSubscription } from 'react-native'; import { assign, EventFrom, send, sendParent, StateFrom } from 'xstate'; diff --git a/machines/scan.ts b/machines/scan.ts index 9fdb4878..71747c28 100644 --- a/machines/scan.ts +++ b/machines/scan.ts @@ -1,5 +1,4 @@ -// import SmartShare from '@idpass/smartshare-react-native'; -const SmartShare = {}; +import SmartShare from '@idpass/smartshare-react-native'; // import LocationEnabler from 'react-native-location-enabler'; const LocationEnabler = {}; import SystemSetting from 'react-native-system-setting'; diff --git a/package-lock.json b/package-lock.json index b40853fc..b5a017fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,6 @@ "": { "name": "mosip-resident-app", "version": "1.0.0", - "hasInstallScript": true, "dependencies": { "@digitalbazaar/ed25519-signature-2018": "digitalbazaar/ed25519-signature-2018", "@digitalbazaar/ed25519-verification-key-2018": "digitalbazaar/ed25519-verification-key-2018", @@ -16,6 +15,7 @@ "@digitalcredentials/vc": "^1.1.2", "@expo-google-fonts/poppins": "^0.2.0", "@expo/metro-config": "^0.3.12", + "@idpass/smartshare-react-native": "idpass/smartshare-react-native#fix/ios-native-module", "@react-native-async-storage/async-storage": "~1.15.0", "@react-native-community/netinfo": "7.1.3", "@react-native-picker/picker": "2.2.1", @@ -3519,6 +3519,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@idpass/smartshare-react-native": { + "version": "0.2.5", + "resolved": "git+ssh://git@github.com/idpass/smartshare-react-native.git#8224b2f3fe97d05159d3ec16e263268732c4cec6", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/@jest/create-cache-key-function": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-26.6.2.tgz", @@ -29118,6 +29127,11 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@idpass/smartshare-react-native": { + "version": "git+ssh://git@github.com/idpass/smartshare-react-native.git#8224b2f3fe97d05159d3ec16e263268732c4cec6", + "from": "@idpass/smartshare-react-native@idpass/smartshare-react-native#fix/ios-native-module", + "requires": {} + }, "@jest/create-cache-key-function": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-26.6.2.tgz", diff --git a/package.json b/package.json index 76f41bea..89a83bc8 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@ "build:android:mosip": "cd android && ./gradlew :app:assembleMosipRelease && cd ..", "build:android:newlogic": "cd android && ./gradlew :app:assembleNewlogicRelease && cd ..", "build:android:ph": "cd android && ./gradlew :app:assemblePhRelease && cd ..", - "i18n:compile-strings": "node scripts/compile-strings.js", - "postinstall": "npx pod-install" + "i18n:compile-strings": "node scripts/compile-strings.js" }, "dependencies": { "@digitalbazaar/ed25519-signature-2018": "digitalbazaar/ed25519-signature-2018", @@ -20,6 +19,7 @@ "@digitalcredentials/vc": "^1.1.2", "@expo-google-fonts/poppins": "^0.2.0", "@expo/metro-config": "^0.3.12", + "@idpass/smartshare-react-native": "idpass/smartshare-react-native#fix/ios-native-module", "@react-native-async-storage/async-storage": "~1.15.0", "@react-native-community/netinfo": "7.1.3", "@react-native-picker/picker": "2.2.1", diff --git a/types/idpass__smartshare-react-native/index.d.ts b/types/idpass__smartshare-react-native/index.d.ts index 12ea6b9b..24e953cc 100644 --- a/types/idpass__smartshare-react-native/index.d.ts +++ b/types/idpass__smartshare-react-native/index.d.ts @@ -2,7 +2,7 @@ import { EmitterSubscription } from 'react-native'; import { BluetoothState } from 'react-native-bluetooth-state-manager'; declare module '@idpass/smartshare-react-native' { - class BluetoothApi { + class IdpassSmartshare { getConnectionParameters: () => string; setConnectionParameters: (params: string) => void; @@ -47,7 +47,7 @@ declare module '@idpass/smartshare-react-native' { pk: string; } - export = new BluetoothApi(); + export = new IdpassSmartshare(); } declare module 'react-native-bluetooth-state-manager' {