@getvouch/react-native-sdk 0.0.3 → 0.1.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.
File without changes
@@ -0,0 +1,2 @@
1
+ #Tue Feb 10 11:13:37 CET 2026
2
+ gradle.version=9.0.0
File without changes
@@ -45,5 +45,5 @@ repositories {
45
45
 
46
46
  dependencies {
47
47
  implementation "com.facebook.react:react-android"
48
- implementation "io.getvouch:android-sdk:0.2.1"
48
+ implementation "io.getvouch:android-sdk:0.3.0"
49
49
  }
package/ios/VouchRN.mm CHANGED
@@ -1,4 +1,5 @@
1
1
  #import "VouchRN.h"
2
+ #import <React/RCTConvert.h>
2
3
  #import <React/RCTLog.h>
3
4
  #import <VouchSDK/VouchSDK-Swift.h>
4
5
 
@@ -31,7 +32,8 @@ RCT_EXPORT_METHOD(initialize : (NSString *)customerId) {
31
32
  return;
32
33
  }
33
34
 
34
- // VouchSDK uses WebKit components which must be initialized on the main thread
35
+ // VouchSDK uses WebKit components which must be initialized on the main
36
+ // thread
35
37
  dispatch_async(dispatch_get_main_queue(), ^{
36
38
  self.sdk = [[VouchSDKBridge alloc] initWithCustomerId:customerId];
37
39
  self.initialized = YES;
@@ -44,12 +46,10 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, isInitialized) {
44
46
  return @(self.initialized);
45
47
  }
46
48
 
47
- RCT_EXPORT_METHOD(start
48
- : (NSString *)dataSourceId webhookUrl
49
- : (NSString *)webhookUrl inputs
50
- : (NSDictionary *)inputs onSuccess
51
- : (RCTResponseSenderBlock)onSuccess onError
52
- : (RCTResponseSenderBlock)onError) {
49
+ RCT_EXPORT_METHOD(start : (NSString *)dataSourceId webhookUrl : (NSString *)
50
+ webhookUrl inputs : (NSDictionary *)inputs onSuccess : (
51
+ RCTResponseSenderBlock)
52
+ onSuccess onError : (RCTResponseSenderBlock)onError) {
53
53
  if (!self.initialized) {
54
54
  RCTLogError(@"VouchSDK must be initialized before calling start");
55
55
  NSDictionary *errorDict = @{
@@ -74,41 +74,47 @@ RCT_EXPORT_METHOD(start
74
74
  }
75
75
 
76
76
  // Call the Swift start method to get the view controller
77
- UIViewController *viewController =
78
- [bridge startWithDataSourceId:dataSourceId
79
- webhookUrl:webhookUrl
80
- inputs:inputsDict
81
- completion:^(VouchSuccessObjC *success, VouchErrorObjC *error) {
82
- dispatch_async(dispatch_get_main_queue(), ^{
83
- // Dismiss the view controller
84
- UIViewController *presentedVC =
85
- [self getRootViewController].presentedViewController;
86
- if (presentedVC) {
87
- [presentedVC dismissViewControllerAnimated:YES
88
- completion:^{
89
- if (success) {
90
- NSDictionary *successDict =
91
- @{@"proofId" : success.proofId};
92
- onSuccess(@[ successDict ]);
93
- } else if (error) {
94
- NSDictionary *errorDict = @{
95
- @"proofId" : error.proofId,
96
- @"reason" : @(error.reason),
97
- @"description" : error.localizedDescription
98
- };
99
- onError(@[ errorDict ]);
100
- }
101
- }];
102
- }
103
- });
104
- }];
77
+ UIViewController *viewController = [bridge
78
+ startWithDataSourceId:dataSourceId
79
+ webhookUrl:webhookUrl
80
+ inputs:inputsDict
81
+ completion:^(VouchSuccessObjC *success,
82
+ VouchErrorObjC *error) {
83
+ dispatch_async(dispatch_get_main_queue(), ^{
84
+ // Dismiss the view controller
85
+ UIViewController *presentedVC =
86
+ [self getRootViewController].presentedViewController;
87
+ if (presentedVC) {
88
+ [presentedVC
89
+ dismissViewControllerAnimated:YES
90
+ completion:^{
91
+ if (success) {
92
+ NSDictionary *successDict =
93
+ @{
94
+ @"proofId" :
95
+ success.proofId
96
+ };
97
+ onSuccess(@[ successDict ]);
98
+ } else if (error) {
99
+ NSDictionary *errorDict = @{
100
+ @"proofId" :
101
+ error.proofId,
102
+ @"reason" :
103
+ @(error.reason),
104
+ @"description" : error
105
+ .localizedDescription
106
+ };
107
+ onError(@[ errorDict ]);
108
+ }
109
+ }];
110
+ }
111
+ });
112
+ }];
105
113
 
106
114
  // Present the view controller modally
107
115
  UIViewController *rootVC = [self getRootViewController];
108
116
  if (rootVC) {
109
- [rootVC presentViewController:viewController
110
- animated:YES
111
- completion:nil];
117
+ [rootVC presentViewController:viewController animated:YES completion:nil];
112
118
  } else {
113
119
  RCTLogError(@"Could not find root view controller to present VouchSDK");
114
120
  NSDictionary *errorDict = @{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvouch/react-native-sdk",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "React Native turbo module for Vouch SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/vouch-rn.podspec CHANGED
@@ -19,5 +19,5 @@ Pod::Spec.new do |s|
19
19
  install_modules_dependencies(s)
20
20
 
21
21
  # Vouch SDK dependency
22
- s.dependency "vouch-ios-sdk", "~> 0.0.8"
22
+ s.dependency "vouch-ios-sdk", "~> 0.1.1"
23
23
  end