Skip to content

Commit

Permalink
CDS-2412 - Add sendcard flag in login success callback for step (#120)
Browse files Browse the repository at this point in the history
* CDS-2412 - Add sendcard flag in login success callback for step

* Fix android

* Fix iOS
  • Loading branch information
Nikunjp1904 authored Nov 21, 2024
1 parent 6b96384 commit 0610e4d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
21 changes: 9 additions & 12 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -1235,7 +1233,6 @@ DEPENDENCIES:
SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- KnotAPI
trunk:
- SocketRocket

EXTERNAL SOURCES:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
5 changes: 3 additions & 2 deletions ios/Knotapi.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion react-native-knotapi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0610e4d

Please sign in to comment.