From 0610e4d830e8dc281e917afba10c3c57eee8a1f7 Mon Sep 17 00:00:00 2001 From: Nikunjp1904 <40294521+Nikunjp1904@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:27:33 +0530 Subject: [PATCH] CDS-2412 - Add sendcard flag in login success callback for step (#120) * CDS-2412 - Add sendcard flag in login success callback for step * Fix android * Fix iOS --- android/build.gradle | 2 +- .../com/reactnativeknotapi/KnotapiModule.java | 3 ++- example/ios/Podfile.lock | 21 ++++++++----------- ios/Knotapi.mm | 5 +++-- react-native-knotapi.podspec | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 35483fe..81a682f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -87,6 +87,6 @@ dependencies { // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" - implementation "com.knotapi.cardonfileswitcher:knotapi-android-sdk:1.0.74" + implementation "com.knotapi.cardonfileswitcher:knotapi-android-sdk:1.0.75" } diff --git a/android/src/main/java/com/reactnativeknotapi/KnotapiModule.java b/android/src/main/java/com/reactnativeknotapi/KnotapiModule.java index 8dcdf3a..84e33b9 100644 --- a/android/src/main/java/com/reactnativeknotapi/KnotapiModule.java +++ b/android/src/main/java/com/reactnativeknotapi/KnotapiModule.java @@ -71,13 +71,14 @@ public void onExit() { } @Override - public void onEvent(String eventName, String merchantName, String taskId) { + public void onEvent(String eventName, String merchantName, String taskId, Boolean sendCard) { WritableMap params = Arguments.createMap(); params.putString("event", eventName); params.putString("merchant", merchantName); if (taskId != null && !taskId.trim().isEmpty()) { params.putString("taskId", taskId); } + params.putBoolean("sendCard", sendCard != null ? sendCard : false); sendEvent(getReactApplicationContext(), prefix + "onEvent", params); } }; diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7cdbc76..6af89bf 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -7,7 +7,7 @@ PODS: - hermes-engine (0.74.3): - hermes-engine/Pre-built (= 0.74.3) - hermes-engine/Pre-built (0.74.3) - - KnotAPI (0.7.6) + - KnotAPI (0.7.7) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -936,10 +936,8 @@ PODS: - React-Mapbuffer (0.74.3): - glog - React-debug - - react-native-knotapi (0.1.86): - - KnotAPI (= 0.7.6) - - react-native-knotapi (0.1.85): - - KnotAPI (= 0.7.5) + - react-native-knotapi (0.1.84): + - KnotAPI (= 0.7.7) - React-Core - React-nativeconfig (0.74.3) - React-NativeModulesApple (0.74.3): @@ -1235,7 +1233,6 @@ DEPENDENCIES: SPEC REPOS: https://github.com/CocoaPods/Specs.git: - KnotAPI - trunk: - SocketRocket EXTERNAL SOURCES: @@ -1353,12 +1350,12 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 + DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 7e977dd099937dc5458851233141583abba49ff2 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: 476ee3e89abb49e07f822b48323c51c57124b572 + glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f hermes-engine: 1f547997900dd0752dc0cc0ae6dd16173c49e09b - KnotAPI: 558636d9e109e6f47af1450a71ed7a6503c5abee + KnotAPI: b72ad9cea100095ad5273185dd8d2d92289a6a79 RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 RCTDeprecation: 4c7eeb42be0b2e95195563c49be08d0b839d22b4 RCTRequired: d530a0f489699c8500e944fde963102c42dcd0c2 @@ -1383,7 +1380,7 @@ SPEC CHECKSUMS: React-jsitracing: 6b3c8c98313642140530f93c46f5a6ca4530b446 React-logger: fa92ba4d3a5d39ac450f59be2a3cec7b099f0304 React-Mapbuffer: 9f68550e7c6839d01411ac8896aea5c868eff63a - react-native-knotapi: 59fae0676fa2b202dd135923794e6e75b5db877d + react-native-knotapi: 729d6f7c7014b0d2c59baa91a2ba3f243839c085 React-nativeconfig: fa5de9d8f4dbd5917358f8ad3ad1e08762f01dcb React-NativeModulesApple: 585d1b78e0597de364d259cb56007052d0bda5e5 React-perflogger: 7bb9ba49435ff66b666e7966ee10082508a203e8 @@ -1408,8 +1405,8 @@ SPEC CHECKSUMS: React-utils: a06061b3887c702235d2dac92dacbd93e1ea079e ReactCommon: f00e436b3925a7ae44dfa294b43ef360fbd8ccc4 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 88480008ccacea6301ff7bf58726e27a72931c8d + Yoga: 04f1db30bb810187397fa4c37dd1868a27af229c PODFILE CHECKSUM: e4b3a2dfe57919242c534f898ad220d3ca14f024 -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/ios/Knotapi.mm b/ios/Knotapi.mm index a80f2ce..aab94f1 100644 --- a/ios/Knotapi.mm +++ b/ios/Knotapi.mm @@ -50,11 +50,12 @@ @implementation Knotapi [strongSelf sendEventWithName:@"CardSwitcher-onSuccess" body:@{@"merchant": merchant}]; }; - self.cardOnFileSwitcherSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId) { + self.cardOnFileSwitcherSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId, BOOL sendCard) { NSMutableDictionary *body = [@{@"event": event, @"merchant": message} mutableCopy]; if (taskId != nil) { body[@"taskId"] = taskId; } + body[@"sendCard"] = @(sendCard); Knotapi * strongSelf = weakSelf; [strongSelf sendEventWithName:@"CardSwitcher-onEvent" body:body]; }; @@ -109,7 +110,7 @@ @implementation Knotapi [strongSelf sendEventWithName:@"SubscriptionManager-onSuccess" body:@{@"merchant": merchant}]; }; - self.subscriptionManagerSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId) { + self.subscriptionManagerSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId, BOOL sendCard) { NSMutableDictionary *body = [@{@"event": event, @"merchant": message} mutableCopy]; if (taskId != nil) { body[@"taskId"] = taskId; diff --git a/react-native-knotapi.podspec b/react-native-knotapi.podspec index 2941573..f4d64b2 100644 --- a/react-native-knotapi.podspec +++ b/react-native-knotapi.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm}" s.dependency "React-Core" - s.dependency 'KnotAPI', '0.7.6' + s.dependency 'KnotAPI', '0.7.7' # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then