From 502550dd3d1c25b5e832d39c9c6cc1ad126e6304 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Mon, 6 Jan 2025 10:58:03 +0100 Subject: [PATCH 01/13] add sentry dependency to podspec and run pod install. --- Example/Podfile.lock | 3 +- Example/SmileID.xcodeproj/project.pbxproj | 128 +++++++++++----------- SmileID.podspec | 1 + Sources/SmileID/Classes/SmileID.swift | 1 + 4 files changed, 68 insertions(+), 65 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 75b1d5a3..f6059b28 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -15,6 +15,7 @@ PODS: - SmileID (10.3.3): - FingerprintJS - lottie-ios (~> 4.4.2) + - Sentry - ZIPFoundation (~> 0.9) - SwiftLint (0.55.1) - ZIPFoundation (0.9.19) @@ -51,7 +52,7 @@ SPEC CHECKSUMS: lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418 netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7 Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57 - SmileID: efa20868a54907b71202c91396377f495e949bb7 + SmileID: 73b3db387a88091a573c109a25f572ad790505dd SwiftLint: 3fe909719babe5537c552ee8181c0031392be933 ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c diff --git a/Example/SmileID.xcodeproj/project.pbxproj b/Example/SmileID.xcodeproj/project.pbxproj index 6d362945..7ea6f01b 100644 --- a/Example/SmileID.xcodeproj/project.pbxproj +++ b/Example/SmileID.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0499F8082970560F0EB3B0FB /* Pods_SmileID_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB9672F4E61EFD2E0BE586D2 /* Pods_SmileID_Example.framework */; }; 1E59E33E2BA1E64C00D2BAD2 /* PartnerParamsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E59E33D2BA1E64C00D2BAD2 /* PartnerParamsTests.swift */; }; 1E60ED372A29C306002695FF /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E60ED322A29C306002695FF /* HomeViewController.swift */; }; 1E60ED382A29C306002695FF /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E60ED332A29C306002695FF /* Constants.swift */; }; @@ -45,7 +46,6 @@ 585BE4882AC7748E0091DDD8 /* RestartableTimerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 585BE4872AC7748E0091DDD8 /* RestartableTimerTest.swift */; }; 58C5F1D82B05925800A6080C /* BiometricKycWithIdInputScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58C5F1D72B05925800A6080C /* BiometricKycWithIdInputScreen.swift */; }; 58C7118C2A69DE920062BBFB /* EnhancedKycTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58C7118B2A69DE920062BBFB /* EnhancedKycTest.swift */; }; - 5A3D2A308CFE21ED82E1D892 /* Pods_SmileID_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4731100B92B3872E881CC531 /* Pods_SmileID_Example.framework */; }; 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 620F1E982B69194900185CD2 /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 620F1E972B69194900185CD2 /* AlertView.swift */; }; @@ -65,7 +65,6 @@ 6AC98B6FFA753C5463F7216F /* SmileConfigEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC984E484EEF69069C705C7 /* SmileConfigEntryView.swift */; }; 6AC98C0E9305B4B3EB66ED35 /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC980584C522B17A099E098 /* Util.swift */; }; 6AC98F5682012E19C815AE70 /* DocumentSelectorViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC9893915EBA33F6984A6D9 /* DocumentSelectorViewModel.swift */; }; - 8AB24EAD1C53FDE9EF66195C /* Pods_SmileID_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34C7EDBA9A9B8CD932A06FE5 /* Pods_SmileID_Tests.framework */; }; 918321EA2A52E36A00D6FB7F /* URLSessionRestServiceClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 918321E02A52E36A00D6FB7F /* URLSessionRestServiceClientTests.swift */; }; 918321EB2A52E36A00D6FB7F /* XCTestExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 918321E12A52E36A00D6FB7F /* XCTestExtension.swift */; }; 918321EC2A52E36A00D6FB7F /* DependencyContainerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 918321E32A52E36A00D6FB7F /* DependencyContainerTests.swift */; }; @@ -74,6 +73,7 @@ 91CB21A52AC10C61005AEBF5 /* NavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91CB21A42AC10C61005AEBF5 /* NavigationBar.swift */; }; 91D9FBC42AB481FE00A8D36B /* PollingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91D9FBC32AB481FE00A8D36B /* PollingTests.swift */; }; 91D9FBD52AB8AB4700A8D36B /* CalculateSignatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91D9FBD42AB8AB4700A8D36B /* CalculateSignatureTests.swift */; }; + E7464710AE95CF2365762DF6 /* Pods_SmileID_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE26CDF1725DB73D242306C4 /* Pods_SmileID_Tests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -87,6 +87,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0FA38531DFF4D2422763FB54 /* Pods-SmileID_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Tests.debug.xcconfig"; path = "Target Support Files/Pods-SmileID_Tests/Pods-SmileID_Tests.debug.xcconfig"; sourceTree = ""; }; 1E59E33D2BA1E64C00D2BAD2 /* PartnerParamsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerParamsTests.swift; sourceTree = ""; }; 1E60ED322A29C306002695FF /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 1E60ED332A29C306002695FF /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; @@ -119,13 +120,12 @@ 20C360C72C454C130008DBDE /* RootViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewModel.swift; sourceTree = ""; }; 20DFA0EB2C21917100AC2AE7 /* View+TextSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+TextSelection.swift"; sourceTree = ""; }; 20F3D6F52C25F5C100B32751 /* SmileID.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SmileID.xcdatamodel; sourceTree = ""; }; - 34C7EDBA9A9B8CD932A06FE5 /* Pods_SmileID_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileID_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4731100B92B3872E881CC531 /* Pods_SmileID_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileID_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4B5DCA2E987F1A330D27225B /* Pods-SmileID_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Tests.debug.xcconfig"; path = "Target Support Files/Pods-SmileID_Tests/Pods-SmileID_Tests.debug.xcconfig"; sourceTree = ""; }; + 2511EE7AD00A24A8575B4585 /* Pods-SmileID_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Example.release.xcconfig"; path = "Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example.release.xcconfig"; sourceTree = ""; }; 5829A8BF2BC7429A001C1E7E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 585BE4872AC7748E0091DDD8 /* RestartableTimerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestartableTimerTest.swift; sourceTree = ""; }; 58C5F1D72B05925800A6080C /* BiometricKycWithIdInputScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricKycWithIdInputScreen.swift; sourceTree = ""; }; 58C7118B2A69DE920062BBFB /* EnhancedKycTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnhancedKycTest.swift; sourceTree = ""; }; + 5ABEC752F93C2B88E8DED799 /* Pods-SmileID_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Tests.release.xcconfig"; path = "Target Support Files/Pods-SmileID_Tests/Pods-SmileID_Tests.release.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* Smile ID.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Smile ID.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -159,10 +159,10 @@ 91D9FBD42AB8AB4700A8D36B /* CalculateSignatureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculateSignatureTests.swift; sourceTree = ""; }; 94E7560A47E255DD8215C183 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 9755B6A19CF28DE212F24C83 /* SmileID.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SmileID.podspec; path = ../SmileID.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + C33E410576AADC1679867B4C /* Pods-SmileID_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Example.debug.xcconfig"; path = "Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example.debug.xcconfig"; sourceTree = ""; }; C8CD2E3DB817D8C6334E9240 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - D17A7A33393463B3A87F13BD /* Pods-SmileID_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Example.release.xcconfig"; path = "Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example.release.xcconfig"; sourceTree = ""; }; - D51F550D2AF51B82A7344D98 /* Pods-SmileID_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Tests.release.xcconfig"; path = "Target Support Files/Pods-SmileID_Tests/Pods-SmileID_Tests.release.xcconfig"; sourceTree = ""; }; - E47B4A90ABD2DAA21990075A /* Pods-SmileID_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Example.debug.xcconfig"; path = "Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example.debug.xcconfig"; sourceTree = ""; }; + CB9672F4E61EFD2E0BE586D2 /* Pods_SmileID_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileID_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FE26CDF1725DB73D242306C4 /* Pods_SmileID_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileID_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -170,7 +170,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5A3D2A308CFE21ED82E1D892 /* Pods_SmileID_Example.framework in Frameworks */, + 0499F8082970560F0EB3B0FB /* Pods_SmileID_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -178,7 +178,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8AB24EAD1C53FDE9EF66195C /* Pods_SmileID_Tests.framework in Frameworks */, + E7464710AE95CF2365762DF6 /* Pods_SmileID_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -299,7 +299,7 @@ 607FACE81AFB9204008FA782 /* Tests */, 607FACD11AFB9204008FA782 /* Products */, 828BF541E068101B2E6ED55F /* Pods */, - 6E4A3D5687B8EA72B1DF35F3 /* Frameworks */, + DD8F5D8589D1377CD9068C72 /* Frameworks */, ); sourceTree = ""; }; @@ -403,22 +403,13 @@ path = CodeScanner; sourceTree = ""; }; - 6E4A3D5687B8EA72B1DF35F3 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 4731100B92B3872E881CC531 /* Pods_SmileID_Example.framework */, - 34C7EDBA9A9B8CD932A06FE5 /* Pods_SmileID_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 828BF541E068101B2E6ED55F /* Pods */ = { isa = PBXGroup; children = ( - E47B4A90ABD2DAA21990075A /* Pods-SmileID_Example.debug.xcconfig */, - D17A7A33393463B3A87F13BD /* Pods-SmileID_Example.release.xcconfig */, - 4B5DCA2E987F1A330D27225B /* Pods-SmileID_Tests.debug.xcconfig */, - D51F550D2AF51B82A7344D98 /* Pods-SmileID_Tests.release.xcconfig */, + C33E410576AADC1679867B4C /* Pods-SmileID_Example.debug.xcconfig */, + 2511EE7AD00A24A8575B4585 /* Pods-SmileID_Example.release.xcconfig */, + 0FA38531DFF4D2422763FB54 /* Pods-SmileID_Tests.debug.xcconfig */, + 5ABEC752F93C2B88E8DED799 /* Pods-SmileID_Tests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -455,6 +446,15 @@ path = ../../Tests/Mocks; sourceTree = ""; }; + DD8F5D8589D1377CD9068C72 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CB9672F4E61EFD2E0BE586D2 /* Pods_SmileID_Example.framework */, + FE26CDF1725DB73D242306C4 /* Pods_SmileID_Tests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -462,13 +462,13 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SmileID_Example" */; buildPhases = ( - B8EF7576DB73381C03B2FE4B /* [CP] Check Pods Manifest.lock */, + 4F4F8C1977AD644055F173A0 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, 917D79282AA8024400FA6624 /* SwiftLint */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, C0BE335FFECD4DF6892309F3 /* Upload Debug Symbols to Sentry */, - 94601622A6BCFA2ACF585332 /* [CP] Embed Pods Frameworks */, + 9075738EC2400F11FD5433CC /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -483,7 +483,7 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SmileID_Tests" */; buildPhases = ( - C6A9034300422F0932BEE6EA /* [CP] Check Pods Manifest.lock */, + 13D97EC2266BF9CC4437873B /* [CP] Check Pods Manifest.lock */, 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, @@ -566,7 +566,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 917D79282AA8024400FA6624 /* SwiftLint */ = { + 13D97EC2266BF9CC4437873B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -574,17 +574,43 @@ inputFileListPaths = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = SwiftLint; + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SmileID_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd ../Sources\n\"${PODS_ROOT}/SwiftLint/swiftlint\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 4F4F8C1977AD644055F173A0 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SmileID_Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - 94601622A6BCFA2ACF585332 /* [CP] Embed Pods Frameworks */ = { + 9075738EC2400F11FD5433CC /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -616,7 +642,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - B8EF7576DB73381C03B2FE4B /* [CP] Check Pods Manifest.lock */ = { + 917D79282AA8024400FA6624 /* SwiftLint */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -624,19 +650,15 @@ inputFileListPaths = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Check Pods Manifest.lock"; + name = SwiftLint; outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SmileID_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd ../Sources\n\"${PODS_ROOT}/SwiftLint/swiftlint\"\n"; }; C0BE335FFECD4DF6892309F3 /* Upload Debug Symbols to Sentry */ = { isa = PBXShellScriptBuildPhase; @@ -653,28 +675,6 @@ shellPath = /bin/sh; shellScript = "# This script is responsable to upload debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\nexport SENTRY_ORG=smile-identity\nexport SENTRY_PROJECT=ios\nERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n"; }; - C6A9034300422F0932BEE6EA /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SmileID_Tests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -885,7 +885,7 @@ }; 607FACF01AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E47B4A90ABD2DAA21990075A /* Pods-SmileID_Example.debug.xcconfig */; + baseConfigurationReference = C33E410576AADC1679867B4C /* Pods-SmileID_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; @@ -918,7 +918,7 @@ }; 607FACF11AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D17A7A33393463B3A87F13BD /* Pods-SmileID_Example.release.xcconfig */; + baseConfigurationReference = 2511EE7AD00A24A8575B4585 /* Pods-SmileID_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Distribution"; @@ -950,7 +950,7 @@ }; 607FACF31AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4B5DCA2E987F1A330D27225B /* Pods-SmileID_Tests.debug.xcconfig */; + baseConfigurationReference = 0FA38531DFF4D2422763FB54 /* Pods-SmileID_Tests.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; @@ -983,7 +983,7 @@ }; 607FACF41AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D51F550D2AF51B82A7344D98 /* Pods-SmileID_Tests.release.xcconfig */; + baseConfigurationReference = 5ABEC752F93C2B88E8DED799 /* Pods-SmileID_Tests.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Distribution"; diff --git a/SmileID.podspec b/SmileID.podspec index b47b612f..49070168 100644 --- a/SmileID.podspec +++ b/SmileID.podspec @@ -10,6 +10,7 @@ Pod::Spec.new do |s| s.dependency 'ZIPFoundation', '~> 0.9' s.dependency 'FingerprintJS' s.dependency 'lottie-ios', '~> 4.4.2' + s.dependency 'Sentry' s.swift_version = '5.5' s.source_files = 'Sources/SmileID/Classes/**/*' s.resource_bundles = { diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index 37b3d3a6..25f5d62f 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -1,5 +1,6 @@ import FingerprintJS import Foundation +import Sentry import SwiftUI import UIKit From 681057010bcd5b9fb0397dc1699a97ad8ba96af5 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Mon, 6 Jan 2025 11:22:11 +0100 Subject: [PATCH 02/13] add sentry dependency to spm --- Package.resolved | 9 +++++++++ Package.swift | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index 713e1c05..3ef19084 100644 --- a/Package.resolved +++ b/Package.resolved @@ -18,6 +18,15 @@ "version" : "4.5.0" } }, + { + "identity" : "sentry-cocoa", + "kind" : "remoteSourceControl", + "location" : "https://github.com/getsentry/sentry-cocoa", + "state" : { + "revision" : "f45e9c62d7a4d9258ac3cf35a3acf9dbab4481d1", + "version" : "8.43.0" + } + }, { "identity" : "zipfoundation", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 0768a9a2..27914f29 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,8 @@ let package = Package( dependencies: [ .package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0")), .package(url: "https://github.com/airbnb/lottie-spm", from: "4.4.2"), - .package(url: "https://github.com/fingerprintjs/fingerprintjs-ios", from: "1.5.0") + .package(url: "https://github.com/fingerprintjs/fingerprintjs-ios", from: "1.5.0"), + .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.43.0") ], targets: [ .target( @@ -23,7 +24,8 @@ let package = Package( dependencies: [ .product(name: "ZIPFoundation", package: "ZIPFoundation"), .product(name: "FingerprintJS", package: "fingerprintjs-ios"), - .product(name: "Lottie", package: "lottie-spm") + .product(name: "Lottie", package: "lottie-spm"), + .product(name: "Sentry", package: "sentry-cocoa") ], path: "Sources/SmileID", resources: [.process("Resources")] From 6f67fe964805190b5c1f15eac7bc35187156f768 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Mon, 6 Jan 2025 11:27:09 +0100 Subject: [PATCH 03/13] set a version for sentry in podspec and podfile. --- Example/Podfile | 2 +- Example/Podfile.lock | 16 ++++++++-------- SmileID.podspec | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index 7d018422..342e26e7 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -4,7 +4,7 @@ platform :ios, '13.0' target 'SmileID_Example' do pod 'SmileID', :path => '../' pod 'netfox' - pod 'Sentry' + pod 'Sentry', '~> 8.43.0' pod 'SwiftLint' pod 'ArkanaKeys', :path => './ArkanaKeys/ArkanaKeys/' pod 'ArkanaKeysInterfaces', :path => './ArkanaKeys/ArkanaKeysInterfaces/' diff --git a/Example/Podfile.lock b/Example/Podfile.lock index f6059b28..dbf34c01 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -9,13 +9,13 @@ PODS: - FingerprintJS/SystemControl (1.5.0) - lottie-ios (4.4.3) - netfox (1.21.0) - - Sentry (8.36.0): - - Sentry/Core (= 8.36.0) - - Sentry/Core (8.36.0) + - Sentry (8.43.0): + - Sentry/Core (= 8.43.0) + - Sentry/Core (8.43.0) - SmileID (10.3.3): - FingerprintJS - lottie-ios (~> 4.4.2) - - Sentry + - Sentry (~> 8.43.0) - ZIPFoundation (~> 0.9) - SwiftLint (0.55.1) - ZIPFoundation (0.9.19) @@ -24,7 +24,7 @@ DEPENDENCIES: - ArkanaKeys (from `./ArkanaKeys/ArkanaKeys/`) - ArkanaKeysInterfaces (from `./ArkanaKeys/ArkanaKeysInterfaces/`) - netfox - - Sentry + - Sentry (~> 8.43.0) - SmileID (from `../`) - SwiftLint @@ -51,11 +51,11 @@ SPEC CHECKSUMS: FingerprintJS: 96410117a394cca04d0f1e2374944c8697f2cceb lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418 netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7 - Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57 - SmileID: 73b3db387a88091a573c109a25f572ad790505dd + Sentry: 532b281a53b1b45a523fd592f608956fb36e577c + SmileID: a7157bf607d875c0c1503f9c20ba1da01bd7afdb SwiftLint: 3fe909719babe5537c552ee8181c0031392be933 ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c -PODFILE CHECKSUM: ebb96bfc1b5a0c7f6061ff1e91ac138e67c1d9f4 +PODFILE CHECKSUM: 3d594b06532c72adf95b06a33b17603190f6e8bb COCOAPODS: 1.16.2 diff --git a/SmileID.podspec b/SmileID.podspec index 49070168..9a6394c3 100644 --- a/SmileID.podspec +++ b/SmileID.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.dependency 'ZIPFoundation', '~> 0.9' s.dependency 'FingerprintJS' s.dependency 'lottie-ios', '~> 4.4.2' - s.dependency 'Sentry' + s.dependency 'Sentry', '~> 8.43.0' s.swift_version = '5.5' s.source_files = 'Sources/SmileID/Classes/**/*' s.resource_bundles = { From 17e5c96d7bbc04540ad56f0721c279946566e058 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Mon, 6 Jan 2025 15:10:37 +0100 Subject: [PATCH 04/13] initialise sentry when sdk is initialised --- Sources/SmileID/Classes/SmileID.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index 25f5d62f..eaeb6531 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -96,14 +96,21 @@ public class SmileID { SmileIDResourcesHelper.registerFonts() let fingerprinter = FingerprinterFactory.getInstance() Task { - /// The fingerprint isn't currently as stable as the Device Identifier, because the v - /// alues might change between OS updates or when the user changes settings + /// The fingerprint isn't currently as stable as the Device Identifier, because the + /// values might change between OS updates or when the user changes settings /// used to compute the previous value. /// https://github.com/fingerprintjs/fingerprintjs-ios if let fingerprint = await fingerprinter.getDeviceId() { deviceId = fingerprint } } + // Initialize Sentry. + SentrySDK.start { options in + options.dsn = "https://d81c446178994daaa52af05a8b3072b9@o1154186.ingest.us.sentry.io/4504162971353088" + options.debug = true + options.tracesSampleRate = 1.0 + options.profilesSampleRate = 1.0 + } } /// Sets the state of offline mode for the SDK. From ecf2722aa549dc4ea7640f88027623268ea3f024 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Fri, 10 Jan 2025 10:03:15 +0100 Subject: [PATCH 05/13] scope configuration for sentry sdk --- Sources/SmileID/Classes/SmileID.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index eaeb6531..a4722574 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -111,6 +111,12 @@ public class SmileID { options.tracesSampleRate = 1.0 options.profilesSampleRate = 1.0 } + SentrySDK.configureScope { scope in + scope.setTag(value: "partner_id", key: SmileID.config.partnerId) + let user = Sentry.User() + user.userId = SmileID.config.partnerId + scope.setUser(user) + } } /// Sets the state of offline mode for the SDK. From 68d8131e2169f35fdbfaee465d73091111b302ab Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Fri, 10 Jan 2025 10:36:55 +0100 Subject: [PATCH 06/13] code that will be later removed --- Example/SmileID/Home/HomeView.swift | 5 +++++ .../View/LivenessCaptureInstructionsView.swift | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Example/SmileID/Home/HomeView.swift b/Example/SmileID/Home/HomeView.swift index 6e095f64..9fba4997 100644 --- a/Example/SmileID/Home/HomeView.swift +++ b/Example/SmileID/Home/HomeView.swift @@ -18,6 +18,11 @@ struct HomeView: View { Text("Test Our Products") .font(SmileID.theme.header2) .foregroundColor(.black) + Button { + fatalError("Test Demo app Crash") + } label: { + Text("Force a crash") + } ScrollView(showsIndicators: false) { LazyVGrid(columns: columns) { ProductCell( diff --git a/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift b/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift index e941d578..3e18bc9e 100644 --- a/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift +++ b/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift @@ -44,6 +44,12 @@ public struct LivenessCaptureInstructionsView: View { isActive: $showSelfieCaptureView ) { EmptyView() } + Button { + fatalError("Test SDK Crash") + } label: { + Text("Force a crash") + } + SmileButton( title: "Action.GetStarted", clicked: { From bc5d082e19761c931342f0a00ee517ea8ac0dd2a Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Fri, 10 Jan 2025 13:32:41 +0100 Subject: [PATCH 07/13] correct key value position --- Sources/SmileID/Classes/SmileID.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index a4722574..f57c4b65 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -112,7 +112,7 @@ public class SmileID { options.profilesSampleRate = 1.0 } SentrySDK.configureScope { scope in - scope.setTag(value: "partner_id", key: SmileID.config.partnerId) + scope.setTag(value: SmileID.config.partnerId, key: "partner_id") let user = Sentry.User() user.userId = SmileID.config.partnerId scope.setUser(user) From 385e72e834dd20b237f8d97b4d459b9e23ab4756 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Mon, 13 Jan 2025 14:55:27 +0100 Subject: [PATCH 08/13] introduce a new error reporting protocol and sentry error reporter class to handle sending of errors to sentry dashboard. --- ErrorReporting.swift | 40 +++++++++++++++++++++++++++ Sources/SmileID/Classes/SmileID.swift | 19 ++++--------- 2 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 ErrorReporting.swift diff --git a/ErrorReporting.swift b/ErrorReporting.swift new file mode 100644 index 00000000..02489535 --- /dev/null +++ b/ErrorReporting.swift @@ -0,0 +1,40 @@ +import Sentry + +protocol ErrorReportingService { + func captureError(_ error: any Error, userInfo: [String: Any]?) +} + +class SentryErrorReporter { + static let shared: SentryErrorReporter = SentryErrorReporter() + + private let sentryHub: SentryHub + + private init() { + // setup sentry options + let options = Sentry.Options() + // TODO: Protect this DSN + options.dsn = "https://d81c446178994daaa52af05a8b3072b9@o1154186.ingest.us.sentry.io/4504162971353088" + options.releaseName = SmileID.version + options.enableCrashHandler = true + options.debug = true + options.tracesSampleRate = 1.0 + options.profilesSampleRate = 1.0 + + // setup sentry scope + let scope = Sentry.Scope() + scope.setTag(value: SmileID.config.partnerId, key: "partner_id") + let user = Sentry.User() + user.userId = SmileID.config.partnerId + scope.setUser(user) + + // setup sentry hub + let sentryClient = SentryClient(options: options) + self.sentryHub = SentryHub(client: sentryClient, andScope: scope) + } +} + +extension SentryErrorReporter: ErrorReportingService { + func captureError(_ error: any Error, userInfo: [String: Any]? = nil) { + sentryHub.capture(error: error) + } +} diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index f57c4b65..a1dd7679 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -40,6 +40,11 @@ public class SmileID { return session }() + // MARK: Sentry Hub + static var sentryHub: SentryHub? + + // MARK: init + private init() {} public private(set) static var config: Config! @@ -104,19 +109,7 @@ public class SmileID { deviceId = fingerprint } } - // Initialize Sentry. - SentrySDK.start { options in - options.dsn = "https://d81c446178994daaa52af05a8b3072b9@o1154186.ingest.us.sentry.io/4504162971353088" - options.debug = true - options.tracesSampleRate = 1.0 - options.profilesSampleRate = 1.0 - } - SentrySDK.configureScope { scope in - scope.setTag(value: SmileID.config.partnerId, key: "partner_id") - let user = Sentry.User() - user.userId = SmileID.config.partnerId - scope.setUser(user) - } + // self.setupSentry() } /// Sets the state of offline mode for the SDK. From e1319030fb44347a1f8b325c8692340bfa752257 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Tue, 14 Jan 2025 13:00:34 +0100 Subject: [PATCH 09/13] introduce arkana keys to the SDK --- .arkana.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .arkana.yml diff --git a/.arkana.yml b/.arkana.yml new file mode 100644 index 00000000..fa424a89 --- /dev/null +++ b/.arkana.yml @@ -0,0 +1,3 @@ +global_secrets: + - SENTRY_DSN +package_manager: cocoapods \ No newline at end of file From 69c86476aff8c769c7cd5ac0c781c480818551f6 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Tue, 14 Jan 2025 14:23:33 +0100 Subject: [PATCH 10/13] install generated ArkanaKeys code as packages for SPM and Cocoapods dependencies. --- ErrorReporting.swift | 4 ++-- Example/Podfile.lock | 4 +++- Example/SmileID.xcodeproj/project.pbxproj | 10 +++++----- Package.swift | 6 ++++-- SmileID.podspec | 2 ++ 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ErrorReporting.swift b/ErrorReporting.swift index 02489535..f67d6bc4 100644 --- a/ErrorReporting.swift +++ b/ErrorReporting.swift @@ -1,3 +1,4 @@ +import ArkanaKeys import Sentry protocol ErrorReportingService { @@ -12,8 +13,7 @@ class SentryErrorReporter { private init() { // setup sentry options let options = Sentry.Options() - // TODO: Protect this DSN - options.dsn = "https://d81c446178994daaa52af05a8b3072b9@o1154186.ingest.us.sentry.io/4504162971353088" + options.dsn = ArkanaKeys.Global.sENTRY_DSN options.releaseName = SmileID.version options.enableCrashHandler = true options.debug = true diff --git a/Example/Podfile.lock b/Example/Podfile.lock index dbf34c01..ea86b974 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -13,6 +13,8 @@ PODS: - Sentry/Core (= 8.43.0) - Sentry/Core (8.43.0) - SmileID (10.3.3): + - ArkanaKeys + - ArkanaKeysInterfaces - FingerprintJS - lottie-ios (~> 4.4.2) - Sentry (~> 8.43.0) @@ -52,7 +54,7 @@ SPEC CHECKSUMS: lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418 netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7 Sentry: 532b281a53b1b45a523fd592f608956fb36e577c - SmileID: a7157bf607d875c0c1503f9c20ba1da01bd7afdb + SmileID: 7430d186554216b80ee6c95ecdefa7b0847a2c2a SwiftLint: 3fe909719babe5537c552ee8181c0031392be933 ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c diff --git a/Example/SmileID.xcodeproj/project.pbxproj b/Example/SmileID.xcodeproj/project.pbxproj index 7ea6f01b..b41a7291 100644 --- a/Example/SmileID.xcodeproj/project.pbxproj +++ b/Example/SmileID.xcodeproj/project.pbxproj @@ -40,7 +40,7 @@ 20B6D5EC2C21CE660023D51C /* DataStoreError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20B6D5EB2C21CE660023D51C /* DataStoreError.swift */; }; 20C360C82C454C130008DBDE /* RootViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20C360C72C454C130008DBDE /* RootViewModel.swift */; }; 20DFA0EC2C21917100AC2AE7 /* View+TextSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20DFA0EB2C21917100AC2AE7 /* View+TextSelection.swift */; }; - 20F3D6F32C25F4D700B32751 /* BuildFile in Sources */ = {isa = PBXBuildFile; }; + 20F3D6F32C25F4D700B32751 /* (null) in Sources */ = {isa = PBXBuildFile; }; 20F3D6F62C25F5C100B32751 /* SmileID.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 20F3D6F42C25F5C100B32751 /* SmileID.xcdatamodeld */; }; 5829A8C02BC7429A001C1E7E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 5829A8BF2BC7429A001C1E7E /* PrivacyInfo.xcprivacy */; }; 585BE4882AC7748E0091DDD8 /* RestartableTimerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 585BE4872AC7748E0091DDD8 /* RestartableTimerTest.swift */; }; @@ -49,7 +49,7 @@ 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 620F1E982B69194900185CD2 /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 620F1E972B69194900185CD2 /* AlertView.swift */; }; - 620F1E9A2B691ABB00185CD2 /* BuildFile in Resources */ = {isa = PBXBuildFile; }; + 620F1E9A2B691ABB00185CD2 /* (null) in Resources */ = {isa = PBXBuildFile; }; 624777D02B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 624777CF2B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift */; }; 62F6766F2B0D173600417419 /* EnhancedKycWithIdInputScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F6766E2B0D173600417419 /* EnhancedKycWithIdInputScreenViewModel.swift */; }; 62F676712B0E00E800417419 /* EnhancedKycResultDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62F676702B0E00E800417419 /* EnhancedKycResultDelegate.swift */; }; @@ -158,7 +158,7 @@ 91D9FBC32AB481FE00A8D36B /* PollingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollingTests.swift; sourceTree = ""; }; 91D9FBD42AB8AB4700A8D36B /* CalculateSignatureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculateSignatureTests.swift; sourceTree = ""; }; 94E7560A47E255DD8215C183 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 9755B6A19CF28DE212F24C83 /* SmileID.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SmileID.podspec; path = ../SmileID.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9755B6A19CF28DE212F24C83 /* SmileID.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SmileID.podspec; path = ../SmileID.podspec; sourceTree = ""; }; C33E410576AADC1679867B4C /* Pods-SmileID_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileID_Example.debug.xcconfig"; path = "Target Support Files/Pods-SmileID_Example/Pods-SmileID_Example.debug.xcconfig"; sourceTree = ""; }; C8CD2E3DB817D8C6334E9240 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; CB9672F4E61EFD2E0BE586D2 /* Pods_SmileID_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileID_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -549,7 +549,7 @@ buildActionMask = 2147483647; files = ( 1EFAB3172A375265008E3C13 /* Images.xcassets in Resources */, - 620F1E9A2B691ABB00185CD2 /* BuildFile in Resources */, + 620F1E9A2B691ABB00185CD2 /* (null) in Resources */, 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 5829A8C02BC7429A001C1E7E /* PrivacyInfo.xcprivacy in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, @@ -698,7 +698,7 @@ 1ED53F6D2A2F28590020BEFB /* SmileTextField.swift in Sources */, 91CB21A52AC10C61005AEBF5 /* NavigationBar.swift in Sources */, 1ED53F6B2A2F28590020BEFB /* ProductCell.swift in Sources */, - 20F3D6F32C25F4D700B32751 /* BuildFile in Sources */, + 20F3D6F32C25F4D700B32751 /* (null) in Sources */, 1E60ED382A29C306002695FF /* Constants.swift in Sources */, 624777D02B0CDC9F00952842 /* EnhancedKycWithIdInputScreen.swift in Sources */, 1ED53F712A2F28590020BEFB /* EnterUserIDView.swift in Sources */, diff --git a/Package.swift b/Package.swift index 27914f29..0e8c1d3a 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,8 @@ let package = Package( .package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0")), .package(url: "https://github.com/airbnb/lottie-spm", from: "4.4.2"), .package(url: "https://github.com/fingerprintjs/fingerprintjs-ios", from: "1.5.0"), - .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.43.0") + .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.43.0"), + .package(name: "ArkanaKeys", path: "./ArkanaKeys") ], targets: [ .target( @@ -25,7 +26,8 @@ let package = Package( .product(name: "ZIPFoundation", package: "ZIPFoundation"), .product(name: "FingerprintJS", package: "fingerprintjs-ios"), .product(name: "Lottie", package: "lottie-spm"), - .product(name: "Sentry", package: "sentry-cocoa") + .product(name: "Sentry", package: "sentry-cocoa"), + .product(name: "ArkanaKeys", package: "ArkanaKeys") ], path: "Sources/SmileID", resources: [.process("Resources")] diff --git a/SmileID.podspec b/SmileID.podspec index 9a6394c3..18d2b7d1 100644 --- a/SmileID.podspec +++ b/SmileID.podspec @@ -11,6 +11,8 @@ Pod::Spec.new do |s| s.dependency 'FingerprintJS' s.dependency 'lottie-ios', '~> 4.4.2' s.dependency 'Sentry', '~> 8.43.0' + s.dependency 'ArkanaKeys' + s.dependency 'ArkanaKeysInterfaces' s.swift_version = '5.5' s.source_files = 'Sources/SmileID/Classes/**/*' s.resource_bundles = { From 9409c8800c29b1fa5a2949e6b02768dc3341a94a Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Tue, 14 Jan 2025 14:29:32 +0100 Subject: [PATCH 11/13] run pod install --- Example/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 2dc7e71e..12b1f4a5 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -54,7 +54,7 @@ SPEC CHECKSUMS: lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418 netfox: 9d5cc727fe7576c4c7688a2504618a156b7d44b7 Sentry: 532b281a53b1b45a523fd592f608956fb36e577c - SmileID: 7430d186554216b80ee6c95ecdefa7b0847a2c2a + SmileID: e1c8829d2d6d0789f36f588bffff204118a3148e SwiftLint: 3fe909719babe5537c552ee8181c0031392be933 ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c From 516ed5fd08a91c0782d4dfbe021759272a817480 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Tue, 14 Jan 2025 14:33:35 +0100 Subject: [PATCH 12/13] remove testing code --- Example/SmileID/Home/HomeView.swift | 5 ----- .../View/LivenessCaptureInstructionsView.swift | 6 ------ Sources/SmileID/Classes/SmileID.swift | 6 ------ 3 files changed, 17 deletions(-) diff --git a/Example/SmileID/Home/HomeView.swift b/Example/SmileID/Home/HomeView.swift index 9fba4997..6e095f64 100644 --- a/Example/SmileID/Home/HomeView.swift +++ b/Example/SmileID/Home/HomeView.swift @@ -18,11 +18,6 @@ struct HomeView: View { Text("Test Our Products") .font(SmileID.theme.header2) .foregroundColor(.black) - Button { - fatalError("Test Demo app Crash") - } label: { - Text("Force a crash") - } ScrollView(showsIndicators: false) { LazyVGrid(columns: columns) { ProductCell( diff --git a/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift b/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift index 3e18bc9e..e941d578 100644 --- a/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift +++ b/Sources/SmileID/Classes/SelfieCapture/View/LivenessCaptureInstructionsView.swift @@ -44,12 +44,6 @@ public struct LivenessCaptureInstructionsView: View { isActive: $showSelfieCaptureView ) { EmptyView() } - Button { - fatalError("Test SDK Crash") - } label: { - Text("Force a crash") - } - SmileButton( title: "Action.GetStarted", clicked: { diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index a1dd7679..ec8e6660 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -40,11 +40,6 @@ public class SmileID { return session }() - // MARK: Sentry Hub - static var sentryHub: SentryHub? - - // MARK: init - private init() {} public private(set) static var config: Config! @@ -109,7 +104,6 @@ public class SmileID { deviceId = fingerprint } } - // self.setupSentry() } /// Sets the state of offline mode for the SDK. From 4347f6ede2461a573f58c7567a6e94ae64c44ee0 Mon Sep 17 00:00:00 2001 From: Tobi Omotayo Date: Tue, 14 Jan 2025 14:52:16 +0100 Subject: [PATCH 13/13] add a flag to SmileID Initializer to enable or disable error reporting. --- .../SmileID/Classes/ErrorReporting.swift | 20 +++++++++++++++---- Sources/SmileID/Classes/SmileID.swift | 14 +++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) rename ErrorReporting.swift => Sources/SmileID/Classes/ErrorReporting.swift (74%) diff --git a/ErrorReporting.swift b/Sources/SmileID/Classes/ErrorReporting.swift similarity index 74% rename from ErrorReporting.swift rename to Sources/SmileID/Classes/ErrorReporting.swift index f67d6bc4..cb5ec5d7 100644 --- a/ErrorReporting.swift +++ b/Sources/SmileID/Classes/ErrorReporting.swift @@ -8,12 +8,18 @@ protocol ErrorReportingService { class SentryErrorReporter { static let shared: SentryErrorReporter = SentryErrorReporter() - private let sentryHub: SentryHub + private var sentryHub: SentryHub? - private init() { + private init() {} + + deinit { + disable() + } + + func enable() { // setup sentry options let options = Sentry.Options() - options.dsn = ArkanaKeys.Global.sENTRY_DSN + options.dsn = ArkanaKeys.Global().sENTRY_DSN options.releaseName = SmileID.version options.enableCrashHandler = true options.debug = true @@ -31,10 +37,16 @@ class SentryErrorReporter { let sentryClient = SentryClient(options: options) self.sentryHub = SentryHub(client: sentryClient, andScope: scope) } + + func disable() { + sentryHub?.getClient()?.options.enableCrashHandler = false + sentryHub?.close() + sentryHub = nil + } } extension SentryErrorReporter: ErrorReportingService { func captureError(_ error: any Error, userInfo: [String: Any]? = nil) { - sentryHub.capture(error: error) + sentryHub?.capture(error: error) } } diff --git a/Sources/SmileID/Classes/SmileID.swift b/Sources/SmileID/Classes/SmileID.swift index ec8e6660..eb264cd5 100644 --- a/Sources/SmileID/Classes/SmileID.swift +++ b/Sources/SmileID/Classes/SmileID.swift @@ -59,17 +59,21 @@ public class SmileID { /// - config: The smile config file. If no value is supplied, we check the app's main bundle /// for a `smile_config.json` file. /// - useSandbox: A boolean to enable the sandbox environment or not + /// - enableErrorReporting: A boolean to enable error reporting for *ONLY* Smile ID related crashes. + /// This is powered by Sentry. /// - requestTimeout: The timeout interval for all requests. /// An interval greater than `defaultRequestTimeout` is recommended. public class func initialize( config: Config = getConfig(), useSandbox: Bool = false, + enableErrorReporting: Bool = true, requestTimeout: TimeInterval = SmileID.defaultRequestTimeout ) { initialize( apiKey: nil, config: config, useSandbox: useSandbox, + enableErrorReporting: enableErrorReporting, requestTimeout: requestTimeout ) } @@ -81,19 +85,29 @@ public class SmileID { /// - config: The smile config file. If no value is supplied, we check the app's main bundle /// for a `smile_config.json` file. /// - useSandbox: A boolean to enable the sandbox environment or not + /// - enableErrorReporting: A boolean to enable error reporting for *ONLY* Smile ID related crashes. + /// This is powered by Sentry. /// - requestTimeout: The timeout interval for all requests. /// An interval greater than `defaultRequestTimeout` is recommended. public class func initialize( apiKey: String? = nil, config: Config = getConfig(), useSandbox: Bool = false, + enableErrorReporting: Bool = true, requestTimeout: TimeInterval = SmileID.defaultRequestTimeout ) { self.config = config self.useSandbox = useSandbox self.apiKey = apiKey self.requestTimeout = requestTimeout + + // Enable crash reporting as early as possible (the pre-req is that the config is loaded) + if enableErrorReporting { + SentryErrorReporter.shared.enable() + } + SmileIDResourcesHelper.registerFonts() + let fingerprinter = FingerprinterFactory.getInstance() Task { /// The fingerprint isn't currently as stable as the Device Identifier, because the