@reclaimprotocol/inapp-rn-sdk 0.1.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/InappRnSdk.podspec +1 -1
  2. package/README.md +12 -7
  3. package/android/build.gradle +3 -3
  4. package/android/generated/java/com/reclaimprotocol/inapp_rn_sdk/NativeInappRnSdkSpec.java +24 -0
  5. package/android/generated/jni/RNInappRnSdkSpec-generated.cpp +21 -0
  6. package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI-generated.cpp +22 -0
  7. package/android/generated/jni/react/renderer/components/RNInappRnSdkSpec/RNInappRnSdkSpecJSI.h +348 -20
  8. package/android/src/main/java/com/reclaimprotocol/inapp_rn_sdk/InappRnSdkModule.kt +140 -20
  9. package/ios/InappRnSdk.mm +65 -11
  10. package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec-generated.mm +48 -0
  11. package/ios/generated/RNInappRnSdkSpec/RNInappRnSdkSpec.h +68 -6
  12. package/ios/generated/RNInappRnSdkSpecJSI-generated.cpp +22 -0
  13. package/ios/generated/RNInappRnSdkSpecJSI.h +348 -20
  14. package/ios/inapp_rn_sdk/Api.swift +124 -7
  15. package/lib/commonjs/ReclaimVerificationPlatformChannel.js +156 -36
  16. package/lib/commonjs/ReclaimVerificationPlatformChannel.js.map +1 -1
  17. package/lib/commonjs/index.js +14 -2
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/specs/NativeInappRnSdk.js +1 -0
  20. package/lib/commonjs/specs/NativeInappRnSdk.js.map +1 -1
  21. package/lib/module/ReclaimVerificationPlatformChannel.js +153 -34
  22. package/lib/module/ReclaimVerificationPlatformChannel.js.map +1 -1
  23. package/lib/module/index.js +10 -4
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/specs/NativeInappRnSdk.js +2 -0
  26. package/lib/module/specs/NativeInappRnSdk.js.map +1 -1
  27. package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts +37 -4
  28. package/lib/typescript/commonjs/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -1
  29. package/lib/typescript/commonjs/src/index.d.ts +5 -3
  30. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  31. package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts +38 -4
  32. package/lib/typescript/commonjs/src/specs/NativeInappRnSdk.d.ts.map +1 -1
  33. package/lib/typescript/commonjs/src/types/proof.d.ts.map +1 -1
  34. package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts +37 -4
  35. package/lib/typescript/module/src/ReclaimVerificationPlatformChannel.d.ts.map +1 -1
  36. package/lib/typescript/module/src/index.d.ts +5 -3
  37. package/lib/typescript/module/src/index.d.ts.map +1 -1
  38. package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts +38 -4
  39. package/lib/typescript/module/src/specs/NativeInappRnSdk.d.ts.map +1 -1
  40. package/lib/typescript/module/src/types/proof.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/ReclaimVerificationPlatformChannel.ts +194 -41
  43. package/src/index.ts +12 -4
  44. package/src/specs/NativeInappRnSdk.ts +51 -6
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
 
17
17
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
18
18
  s.private_header_files = "ios/generated/**/*.h"
19
- s.dependency "ReclaimInAppSdk"
19
+ s.dependency "ReclaimInAppSdk", "~> 0.3.0"
20
20
 
21
21
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
22
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
package/README.md CHANGED
@@ -15,7 +15,7 @@ This SDK allows you to integrate Reclaim's in-app verification process into your
15
15
 
16
16
  ## Example
17
17
 
18
- - See the [Reclaim Example - React Native](example/README.md) for a complete example of how to use the SDK in a React Native application.
18
+ - See the [Reclaim Example - React Native](samples/example_new_arch/README.md) for a complete example of how to use the SDK in a React Native application.
19
19
 
20
20
  ## Installation
21
21
 
@@ -59,7 +59,7 @@ add the following to the end of settings.gradle:
59
59
  dependencyResolutionManagement {
60
60
  repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
61
61
  String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
62
- String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
62
+ String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.3.0/repo"
63
63
  repositories {
64
64
  google()
65
65
  mavenCentral()
@@ -78,7 +78,7 @@ or alternatively add the following repositories to the relevant repositories blo
78
78
 
79
79
  ```groovy
80
80
  String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
81
- String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
81
+ String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.3.0/repo"
82
82
  maven {
83
83
  url "$reclaimStorageUrl"
84
84
  }
@@ -108,13 +108,13 @@ Ignore if you already have this declaration in your `Podfile`.
108
108
 
109
109
  ```ruby
110
110
  # Cocoapods is the recommended way to install the SDK.
111
- pod 'ReclaimInAppSdk', '~> 0.1.4'
111
+ pod 'ReclaimInAppSdk', '~> 0.3.0'
112
112
  ```
113
113
 
114
114
  ##### From a specific tag
115
115
 
116
116
  ```ruby
117
- pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.1.4'
117
+ pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.3.0'
118
118
  ```
119
119
 
120
120
  ##### From git HEAD
@@ -126,7 +126,7 @@ pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp
126
126
  ##### From a specific commit
127
127
 
128
128
  ```ruby
129
- pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :commit => '184d41628026768feb703dc7bb9a3d913c6b271e'
129
+ pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :commit => 'eeb5a5484a5927217065e5c988fab8201cb2db2e'
130
130
  ```
131
131
 
132
132
  ##### From a specific branch
@@ -151,7 +151,7 @@ target 'InappRnSdkExample' do
151
151
  )
152
152
 
153
153
  # This is the line that you may need to add in your podfile.
154
- pod 'ReclaimInAppSdk', '~> 0.1.4'
154
+ pod 'ReclaimInAppSdk', '~> 0.3.0'
155
155
 
156
156
  pre_install do |installer|
157
157
  system("cd ../../ && npx bob build --target codegen")
@@ -288,6 +288,11 @@ error.reason
288
288
  error.innerError
289
289
  ```
290
290
 
291
+ ## Migration
292
+
293
+ - Migration steps for [0.3.0](https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/blob/main/documentation/migration.md#030)
294
+ - Migration steps for [0.2.1](https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/blob/main/documentation/migration.md#021)
295
+
291
296
  ## Advanced Usage
292
297
 
293
298
  ### Overriding SDK Config
@@ -3,7 +3,7 @@ buildscript {
3
3
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['InappRnSdk_' + name]
4
4
  }
5
5
  String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
6
- String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
6
+ String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.3.0/repo"
7
7
  repositories {
8
8
  google()
9
9
  mavenCentral()
@@ -98,7 +98,7 @@ android {
98
98
  }
99
99
 
100
100
  String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
101
- String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
101
+ String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.3.0/repo"
102
102
 
103
103
  repositories {
104
104
  mavenCentral()
@@ -118,7 +118,7 @@ dependencies {
118
118
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
119
119
 
120
120
  //noinspection UseTomlInstead
121
- implementation "org.reclaimprotocol:inapp_sdk:0.1.2"
121
+ implementation "org.reclaimprotocol:inapp_sdk:0.3.0"
122
122
  }
123
123
 
124
124
  if (isNewArchitectureEnabled()) {
@@ -49,6 +49,18 @@ public abstract class NativeInappRnSdkSpec extends ReactContextBaseJavaModule im
49
49
  mEventEmitterCallback.invoke("onSessionUpdateRequest", value);
50
50
  }
51
51
 
52
+ protected final void emitOnProviderInformationRequest(ReadableMap value) {
53
+ mEventEmitterCallback.invoke("onProviderInformationRequest", value);
54
+ }
55
+
56
+ protected final void emitOnReclaimAttestorAuthRequest(ReadableMap value) {
57
+ mEventEmitterCallback.invoke("onReclaimAttestorAuthRequest", value);
58
+ }
59
+
60
+ protected final void emitOnSessionIdentityUpdate(ReadableMap value) {
61
+ mEventEmitterCallback.invoke("onSessionIdentityUpdate", value);
62
+ }
63
+
52
64
  @ReactMethod
53
65
  @DoNotStrip
54
66
  public abstract void startVerification(ReadableMap request, Promise promise);
@@ -61,10 +73,22 @@ public abstract class NativeInappRnSdkSpec extends ReactContextBaseJavaModule im
61
73
  @DoNotStrip
62
74
  public abstract void setOverrides(ReadableMap overrides, Promise promise);
63
75
 
76
+ @ReactMethod
77
+ @DoNotStrip
78
+ public abstract void clearAllOverrides(Promise promise);
79
+
80
+ @ReactMethod
81
+ @DoNotStrip
82
+ public abstract void setVerificationOptions(ReadableMap args, Promise promise);
83
+
64
84
  @ReactMethod
65
85
  @DoNotStrip
66
86
  public abstract void reply(String replyId, boolean reply);
67
87
 
88
+ @ReactMethod
89
+ @DoNotStrip
90
+ public abstract void replyWithString(String replyId, String value);
91
+
68
92
  @ReactMethod
69
93
  @DoNotStrip
70
94
  public abstract void ping(Promise promise);
@@ -27,11 +27,26 @@ static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_setOverrides(
27
27
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setOverrides", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
28
  }
29
29
 
30
+ static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_clearAllOverrides(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
+ static jmethodID cachedMethodId = nullptr;
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "clearAllOverrides", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
33
+ }
34
+
35
+ static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_setVerificationOptions(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
36
+ static jmethodID cachedMethodId = nullptr;
37
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setVerificationOptions", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
38
+ }
39
+
30
40
  static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_reply(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
41
  static jmethodID cachedMethodId = nullptr;
32
42
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "reply", "(Ljava/lang/String;Z)V", args, count, cachedMethodId);
33
43
  }
34
44
 
45
+ static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_replyWithString(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
46
+ static jmethodID cachedMethodId = nullptr;
47
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "replyWithString", "(Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
48
+ }
49
+
35
50
  static facebook::jsi::Value __hostFunction_NativeInappRnSdkSpecJSI_ping(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
36
51
  static jmethodID cachedMethodId = nullptr;
37
52
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "ping", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
@@ -42,12 +57,18 @@ NativeInappRnSdkSpecJSI::NativeInappRnSdkSpecJSI(const JavaTurboModule::InitPara
42
57
  methodMap_["startVerification"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkSpecJSI_startVerification};
43
58
  methodMap_["startVerificationFromUrl"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkSpecJSI_startVerificationFromUrl};
44
59
  methodMap_["setOverrides"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkSpecJSI_setOverrides};
60
+ methodMap_["clearAllOverrides"] = MethodMetadata {0, __hostFunction_NativeInappRnSdkSpecJSI_clearAllOverrides};
61
+ methodMap_["setVerificationOptions"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkSpecJSI_setVerificationOptions};
45
62
  methodMap_["reply"] = MethodMetadata {2, __hostFunction_NativeInappRnSdkSpecJSI_reply};
63
+ methodMap_["replyWithString"] = MethodMetadata {2, __hostFunction_NativeInappRnSdkSpecJSI_replyWithString};
46
64
  methodMap_["ping"] = MethodMetadata {0, __hostFunction_NativeInappRnSdkSpecJSI_ping};
47
65
  eventEmitterMap_["onLogs"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
48
66
  eventEmitterMap_["onSessionLogs"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
49
67
  eventEmitterMap_["onSessionCreateRequest"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
50
68
  eventEmitterMap_["onSessionUpdateRequest"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
69
+ eventEmitterMap_["onProviderInformationRequest"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
70
+ eventEmitterMap_["onReclaimAttestorAuthRequest"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
71
+ eventEmitterMap_["onSessionIdentityUpdate"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
51
72
  setEventEmitterCallback(params.instance);
52
73
  }
53
74
 
@@ -29,6 +29,17 @@ static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_setOverrides(jsi::Ru
29
29
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
30
30
  );
31
31
  }
32
+ static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_clearAllOverrides(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
33
+ return static_cast<NativeInappRnSdkCxxSpecJSI *>(&turboModule)->clearAllOverrides(
34
+ rt
35
+ );
36
+ }
37
+ static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_setVerificationOptions(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
38
+ return static_cast<NativeInappRnSdkCxxSpecJSI *>(&turboModule)->setVerificationOptions(
39
+ rt,
40
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
41
+ );
42
+ }
32
43
  static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_reply(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
33
44
  static_cast<NativeInappRnSdkCxxSpecJSI *>(&turboModule)->reply(
34
45
  rt,
@@ -37,6 +48,14 @@ static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_reply(jsi::Runtime &
37
48
  );
38
49
  return jsi::Value::undefined();
39
50
  }
51
+ static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_replyWithString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
52
+ static_cast<NativeInappRnSdkCxxSpecJSI *>(&turboModule)->replyWithString(
53
+ rt,
54
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
55
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
56
+ );
57
+ return jsi::Value::undefined();
58
+ }
40
59
  static jsi::Value __hostFunction_NativeInappRnSdkCxxSpecJSI_ping(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
41
60
  return static_cast<NativeInappRnSdkCxxSpecJSI *>(&turboModule)->ping(
42
61
  rt
@@ -48,7 +67,10 @@ NativeInappRnSdkCxxSpecJSI::NativeInappRnSdkCxxSpecJSI(std::shared_ptr<CallInvok
48
67
  methodMap_["startVerification"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkCxxSpecJSI_startVerification};
49
68
  methodMap_["startVerificationFromUrl"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkCxxSpecJSI_startVerificationFromUrl};
50
69
  methodMap_["setOverrides"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkCxxSpecJSI_setOverrides};
70
+ methodMap_["clearAllOverrides"] = MethodMetadata {0, __hostFunction_NativeInappRnSdkCxxSpecJSI_clearAllOverrides};
71
+ methodMap_["setVerificationOptions"] = MethodMetadata {1, __hostFunction_NativeInappRnSdkCxxSpecJSI_setVerificationOptions};
51
72
  methodMap_["reply"] = MethodMetadata {2, __hostFunction_NativeInappRnSdkCxxSpecJSI_reply};
73
+ methodMap_["replyWithString"] = MethodMetadata {2, __hostFunction_NativeInappRnSdkCxxSpecJSI_replyWithString};
52
74
  methodMap_["ping"] = MethodMetadata {0, __hostFunction_NativeInappRnSdkCxxSpecJSI_ping};
53
75
  }
54
76