diff --git a/app/App.tsx b/app/App.tsx index ad5f9301..cc27c082 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -10,6 +10,7 @@ import { AMPLITUDE_KEY } from '@env'; import * as amplitude from '@amplitude/analytics-react-native'; import useUserStore from './src/stores/userStore'; import { bgWhite } from './src/utils/colors'; +import { setupUniversalLinkListener } from './src/utils/qrCode'; // Adjust the import path as needed global.Buffer = Buffer; function App(): React.JSX.Element { @@ -29,13 +30,18 @@ function App(): React.JSX.Element { useEffect(() => { setSelectedTab('splash'); }, [setSelectedTab]); - + useEffect(() => { if (AMPLITUDE_KEY) { amplitude.init(AMPLITUDE_KEY); } }, []); + useEffect(() => { + const cleanup = setupUniversalLinkListener(); + return cleanup; + }, []); + return ( diff --git a/app/ios/OpenPassport.xcodeproj/project.pbxproj b/app/ios/OpenPassport.xcodeproj/project.pbxproj index f28f73b2..799b80b3 100644 --- a/app/ios/OpenPassport.xcodeproj/project.pbxproj +++ b/app/ios/OpenPassport.xcodeproj/project.pbxproj @@ -107,6 +107,7 @@ 1686F0DB2C500F3800841CDE /* QRScannerBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRScannerBridge.swift; sourceTree = ""; }; 1686F0DD2C500F4F00841CDE /* QRScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRScannerViewController.swift; sourceTree = ""; }; 1686F0DF2C500FBD00841CDE /* QRScannerBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QRScannerBridge.m; sourceTree = ""; }; + 169349842CC694DA00166F21 /* OpenPassportDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = OpenPassportDebug.entitlements; path = OpenPassport/OpenPassportDebug.entitlements; sourceTree = ""; }; 16E6646D2B8D292500FDD6A0 /* QKMRZScannerViewRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QKMRZScannerViewRepresentable.swift; sourceTree = ""; }; 16E884A42C5BD764003B7125 /* passport.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = passport.json; sourceTree = ""; }; 7C737C07B2C3788F9AB02DE4 /* Pods-OpenPassport.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenPassport.release.xcconfig"; path = "Target Support Files/Pods-OpenPassport/Pods-OpenPassport.release.xcconfig"; sourceTree = ""; }; @@ -180,6 +181,7 @@ 13B07FAE1A68108700A75B9A /* OpenPassport */ = { isa = PBXGroup; children = ( + 169349842CC694DA00166F21 /* OpenPassportDebug.entitlements */, 16E884A42C5BD764003B7125 /* passport.json */, 05EDEDC42B52D25D00AA51AD /* Prover.m */, 05EDEDC52B52D25D00AA51AD /* Prover.swift */, @@ -491,7 +493,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = OpenPassport/OpenPassport.entitlements; + CODE_SIGN_ENTITLEMENTS = OpenPassport/OpenPassportDebug.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 63; diff --git a/app/ios/OpenPassport/AppDelegate.mm b/app/ios/OpenPassport/AppDelegate.mm index 4973504e..9fa81e53 100644 --- a/app/ios/OpenPassport/AppDelegate.mm +++ b/app/ios/OpenPassport/AppDelegate.mm @@ -1,8 +1,8 @@ #import "AppDelegate.h" - #import #import #import +#import @implementation AppDelegate @@ -30,4 +30,13 @@ - (NSURL *)bundleURL #endif } -@end \ No newline at end of file +- (BOOL)application:(UIApplication *)application +continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler +{ + return [RCTLinkingManager application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]; +} + +@end diff --git a/app/ios/OpenPassport/Info.plist b/app/ios/OpenPassport/Info.plist index e6c4e820..a58ca05b 100644 --- a/app/ios/OpenPassport/Info.plist +++ b/app/ios/OpenPassport/Info.plist @@ -70,5 +70,14 @@ A0000002472001 00000000000000 + CFBundleURLTypes + + + CFBundleURLSchemes + + proofofpassport + + + diff --git a/app/ios/OpenPassport/OpenPassport.entitlements b/app/ios/OpenPassport/OpenPassport.entitlements index 1c1da77f..c86eca21 100644 --- a/app/ios/OpenPassport/OpenPassport.entitlements +++ b/app/ios/OpenPassport/OpenPassport.entitlements @@ -11,6 +11,7 @@ appclips:openpassport.app appclips:staging.openpassport.app appclips:appclip.openpassport.app + applinks:proofofpassport-merkle-tree.xyz com.apple.developer.nfc.readersession.formats diff --git a/app/ios/OpenPassport/OpenPassportDebug.entitlements b/app/ios/OpenPassport/OpenPassportDebug.entitlements new file mode 100644 index 00000000..c86eca21 --- /dev/null +++ b/app/ios/OpenPassport/OpenPassportDebug.entitlements @@ -0,0 +1,23 @@ + + + + + com.apple.developer.associated-appclip-app-identifiers + + 5B29R5LYHQ.com.warroom.proofofpassport.Clip + + com.apple.developer.associated-domains + + appclips:openpassport.app + appclips:staging.openpassport.app + appclips:appclip.openpassport.app + applinks:proofofpassport-merkle-tree.xyz + + com.apple.developer.nfc.readersession.formats + + TAG + + com.apple.security.device.camera + + + diff --git a/app/src/screens/MainScreen.tsx b/app/src/screens/MainScreen.tsx index c060525a..da78a562 100644 --- a/app/src/screens/MainScreen.tsx +++ b/app/src/screens/MainScreen.tsx @@ -25,7 +25,6 @@ import ProveScreen from './ProveScreen'; import NfcScreen from './NfcScreen'; import CameraScreen from './CameraScreen'; import NextScreen from './NextScreen'; -import RegisterScreen from './RegisterScreen'; import AppScreen from './AppScreen'; // import constants import { RPC_URL, SignatureAlgorithmIndex } from '../../../common/src/constants/constants'; @@ -336,14 +335,6 @@ const MainScreen: React.FC = () => { -
- - -