From 9a34f87ff870a2321e7ec006d7ce067300af429c Mon Sep 17 00:00:00 2001 From: Orkun Date: Tue, 19 Nov 2024 13:51:39 +0300 Subject: [PATCH 01/42] feat: update ios and android agents to v2.7.0 --- RNFingerprintjsPro.podspec | 2 +- android/build.gradle | 2 +- src/types.ts | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RNFingerprintjsPro.podspec b/RNFingerprintjsPro.podspec index 4627435..643b791 100644 --- a/RNFingerprintjsPro.podspec +++ b/RNFingerprintjsPro.podspec @@ -14,5 +14,5 @@ Pod::Spec.new do |s| # s.requires_arc = true s.dependency "React-Core" - s.dependency "FingerprintPro", '~> 2.6.0' + s.dependency "FingerprintPro", '~> 2.7.0', '< 3.0.0' end diff --git a/android/build.gradle b/android/build.gradle index c80bf89..a8d01dd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -46,6 +46,6 @@ repositories { dependencies { implementation 'com.facebook.react:react-native:+' - implementation "com.fingerprint.android:pro:[2.6.0, 3.0.0)" + implementation "com.fingerprint.android:pro:[2.7.0, 3.0.0)" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/src/types.ts b/src/types.ts index 7d6e93b..4a3c080 100644 --- a/src/types.ts +++ b/src/types.ts @@ -73,6 +73,10 @@ export interface ShortVisitorData { * A confidence score that tells how much the agent is sure about the visitor identifier */ confidence: Confidence + /** + * See more details in the Sealed Client Results(https://dev.fingerprint.com/docs/sealed-client-results) guide. The field will miss if Sealed Client Results are disabled or unavailable for another reason. + */ + sealedResult?: string } /** From b126eaaaa6793ff42fef78ecef764332aff3fc74 Mon Sep 17 00:00:00 2001 From: Orkun Date: Tue, 19 Nov 2024 14:15:43 +0300 Subject: [PATCH 02/42] chore: update test project podfile lock --- TestProject/ios/Podfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TestProject/ios/Podfile.lock b/TestProject/ios/Podfile.lock index e80bdae..6567abf 100644 --- a/TestProject/ios/Podfile.lock +++ b/TestProject/ios/Podfile.lock @@ -9,7 +9,7 @@ PODS: - React-Core (= 0.73.2) - React-jsi (= 0.73.2) - ReactCommon/turbomodule/core (= 0.73.2) - - FingerprintPro (2.6.0) + - FingerprintPro (2.7.0) - fmt (6.2.1) - glog (0.3.5) - hermes-engine (0.73.2): @@ -1055,7 +1055,7 @@ PODS: - React-logger (= 0.73.2) - React-perflogger (= 0.73.2) - RNFingerprintjsPro (1.0.4): - - FingerprintPro (~> 2.6.0) + - FingerprintPro (< 3.0.0, ~> 2.7.0) - React-Core - SocketRocket (0.6.1) - Yoga (1.14.0) @@ -1227,7 +1227,7 @@ SPEC CHECKSUMS: DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4 FBReactNativeSpec: 86de768f89901ef6ed3207cd686362189d64ac88 - FingerprintPro: 3f06f491c77d871ab543b49fd25fddc52dc34f8c + FingerprintPro: 0c7dbd28fc83751ca64b06328e2fb22bbc7ed118 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b hermes-engine: b361c9ef5ef3cda53f66e195599b47e1f84ffa35 @@ -1273,7 +1273,7 @@ SPEC CHECKSUMS: React-runtimescheduler: df8945a656356ff10f58f65a70820478bfcf33ad React-utils: f5bc61e7ea3325c0732ae2d755f4441940163b85 ReactCommon: 45b5d4f784e869c44a6f5a8fad5b114ca8f78c53 - RNFingerprintjsPro: 5a6f377649bc343770e4c28dd2ba9476a918b9fc + RNFingerprintjsPro: 3fabeec739a491c69e996a99928e37c7de8f842e SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: 13c8ef87792450193e117976337b8527b49e8c03 From bb0e619c53a8e93b57bda2ce0288c2468413afd2 Mon Sep 17 00:00:00 2001 From: Orkun Date: Tue, 19 Nov 2024 14:53:34 +0300 Subject: [PATCH 03/42] chore: update podspec minimum version operator Co-authored-by: Ilya Taratukhin --- RNFingerprintjsPro.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNFingerprintjsPro.podspec b/RNFingerprintjsPro.podspec index 643b791..858e67c 100644 --- a/RNFingerprintjsPro.podspec +++ b/RNFingerprintjsPro.podspec @@ -14,5 +14,5 @@ Pod::Spec.new do |s| # s.requires_arc = true s.dependency "React-Core" - s.dependency "FingerprintPro", '~> 2.7.0', '< 3.0.0' + s.dependency "FingerprintPro", '>= 2.7.0', '< 3.0.0' end From 58d72b9643a5b7c4b0fc7117e0e6a55debe575ee Mon Sep 17 00:00:00 2001 From: Orkun Date: Wed, 27 Nov 2024 16:32:29 +0300 Subject: [PATCH 04/42] chore: wip update native modules for exporting required members --- .../reactnative/RNFingerprintjsProModule.kt | 2 +- ios/RNFingerprintjsPro.swift | 3 ++- src/FingerprintJsProAgent.ts | 14 +++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/com/fingerprintjs/reactnative/RNFingerprintjsProModule.kt b/android/src/main/java/com/fingerprintjs/reactnative/RNFingerprintjsProModule.kt index 261407c..6e31c08 100644 --- a/android/src/main/java/com/fingerprintjs/reactnative/RNFingerprintjsProModule.kt +++ b/android/src/main/java/com/fingerprintjs/reactnative/RNFingerprintjsProModule.kt @@ -72,7 +72,7 @@ class RNFingerprintjsProModule(reactContext: ReactApplicationContext) : ReactCon try { fpjsClient?.getVisitorId(tags?.toHashMap() ?: emptyMap(), linkedId ?: "", - { result -> promise.resolve(Arguments.fromList(listOf(result.requestId, result.confidenceScore.score, result.asJson))) }, + { result -> promise.resolve(Arguments.fromList(listOf(result.requestId, result.confidenceScore.score, result.asJson, result.sealedResult))) }, { error -> promise.reject("Error: ", getErrorDescription(error)) }) } catch (e: Exception) { diff --git a/ios/RNFingerprintjsPro.swift b/ios/RNFingerprintjsPro.swift index 5f65e31..85e31d1 100644 --- a/ios/RNFingerprintjsPro.swift +++ b/ios/RNFingerprintjsPro.swift @@ -54,7 +54,8 @@ class RNFingerprintjsPro: NSObject { let tuple = [ visitorDataResponse.requestId, visitorDataResponse.confidence, - visitorDataResponse.asJSON() + visitorDataResponse.asJSON(), + visitorDataResponse.sealedResult, ] as [Any] resolve(tuple) } diff --git a/src/FingerprintJsProAgent.ts b/src/FingerprintJsProAgent.ts index 7decdf7..7ba06e6 100644 --- a/src/FingerprintJsProAgent.ts +++ b/src/FingerprintJsProAgent.ts @@ -64,17 +64,21 @@ export class FingerprintJsProAgent { */ public async getVisitorData(tags?: Tags, linkedId?: string): Promise { try { - const [requestId, confidenceScore, visitorDataJsonString] = await NativeModules.RNFingerprintjsPro.getVisitorData( - tags, - linkedId - ) - return { + const [requestId, confidenceScore, visitorDataJsonString, sealedResult] = + await NativeModules.RNFingerprintjsPro.getVisitorData(tags, linkedId) + const result = { ...JSON.parse(visitorDataJsonString), requestId, confidence: { score: confidenceScore, }, } + + if (sealedResult) { + result['sealedResult'] = sealedResult + } + + return result } catch (error) { if (error instanceof Error) { throw unwrapError(error) From de48e5ee0b1379dd9d1cb9effc75478ff49cbf21 Mon Sep 17 00:00:00 2001 From: Orkun Date: Thu, 28 Nov 2024 14:15:17 +0300 Subject: [PATCH 05/42] feat: add sealed result support to sdk --- TestProject/ios/Podfile.lock | 12 ++++++------ TestProject/src/Visitor.js | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/TestProject/ios/Podfile.lock b/TestProject/ios/Podfile.lock index 6567abf..8fdebcc 100644 --- a/TestProject/ios/Podfile.lock +++ b/TestProject/ios/Podfile.lock @@ -1055,7 +1055,7 @@ PODS: - React-logger (= 0.73.2) - React-perflogger (= 0.73.2) - RNFingerprintjsPro (1.0.4): - - FingerprintPro (< 3.0.0, ~> 2.7.0) + - FingerprintPro (< 3.0.0, >= 2.7.0) - React-Core - SocketRocket (0.6.1) - Yoga (1.14.0) @@ -1224,12 +1224,12 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 + DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 FBLazyVector: fbc4957d9aa695250b55d879c1d86f79d7e69ab4 FBReactNativeSpec: 86de768f89901ef6ed3207cd686362189d64ac88 FingerprintPro: 0c7dbd28fc83751ca64b06328e2fb22bbc7ed118 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b + glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: b361c9ef5ef3cda53f66e195599b47e1f84ffa35 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 @@ -1273,10 +1273,10 @@ SPEC CHECKSUMS: React-runtimescheduler: df8945a656356ff10f58f65a70820478bfcf33ad React-utils: f5bc61e7ea3325c0732ae2d755f4441940163b85 ReactCommon: 45b5d4f784e869c44a6f5a8fad5b114ca8f78c53 - RNFingerprintjsPro: 3fabeec739a491c69e996a99928e37c7de8f842e + RNFingerprintjsPro: 7437638503c6257e54b6d84406c1b6c65a50c499 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Yoga: 13c8ef87792450193e117976337b8527b49e8c03 + Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 PODFILE CHECKSUM: ab81067ce8c7c4c73b9d3ab72ba8cc955f098393 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/TestProject/src/Visitor.js b/TestProject/src/Visitor.js index e185a2d..a7556fb 100644 --- a/TestProject/src/Visitor.js +++ b/TestProject/src/Visitor.js @@ -51,11 +51,17 @@ const linkedId = 'React native' export const Visitor = () => { const { isLoading, data, getData, error } = useVisitorData() const [modalVisible, setModalVisible] = useState(false) + const [sealedResultModalVisible, setSealedResultModalVisible] = useState(false) const onLoadData = () => { getData() } + const onLoadSealedResult = () => { + getData() + setSealedResultModalVisible(true) + } + const onLoadDataWithTag = () => { getData(tags, linkedId) } @@ -75,6 +81,7 @@ export const Visitor = () => { } const extendedResult = JSON.stringify(data, null, ' ') + const sealedResultInfo = JSON.stringify(data?.sealedResult ?? '', null, ' ') return ( @@ -83,7 +90,25 @@ export const Visitor = () => {