Skip to content

Commit 7171ce4

Browse files
Merge pull request #137 from smallcase/release/v7.0.1
chore(release): 7.0.1
2 parents 8f5666d + 99b07c3 commit 7171ce4

12 files changed

Lines changed: 69 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [7.0.1](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.0.0...v7.0.1) (2026-01-14)
6+
7+
8+
### Features
9+
10+
* **a/b-test:** working state ([48a33a1](https://github.com/smallcase/react-native-smallcase-gateway/commit/48a33a1cfa35f0df09edf11b92db3d3d775cf166))
11+
* **a/b-test:** working state ([705b3bf](https://github.com/smallcase/react-native-smallcase-gateway/commit/705b3bfa84d4368cc300f9fa00e80812f465610d))
12+
* **chore:** opener ab test iOS SC App ([240cea7](https://github.com/smallcase/react-native-smallcase-gateway/commit/240cea7f9cc2ca1daf42c4ae763c537bb6079eb5))
13+
* **gateway-sdk:** pass user ID in init for A/B testing ([bf1284a](https://github.com/smallcase/react-native-smallcase-gateway/commit/bf1284aab46195958b75336f4297e7fc06b32b6f))
14+
* **gateway-sdk:** pass user ID in init for A/B testing ([368e911](https://github.com/smallcase/react-native-smallcase-gateway/commit/368e9117ccef8d1d7232d423d905f3f82d846410))
15+
516
## [7.0.0](https://github.com/smallcase/react-native-smallcase-gateway/compare/v6.0.0...v7.0.0) (2026-01-05)
617

718

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
149149
dependencies {
150150
//noinspection GradleDynamicVersion
151151
implementation 'com.facebook.react:react-native:+' // From node_modules
152-
implementation 'com.smallcase.gateway:sdk:6.0.0'
152+
implementation 'com.smallcase.gateway:sdk:6.0.1'
153153
implementation 'com.smallcase.loans:sdk:4.0.0'
154154
implementation "androidx.core:core-ktx:1.3.1"
155155
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte
2525

2626
@ReactMethod
2727
fun setConfigEnvironment(envName: String, gateway: String, isLeprechaunActive: Boolean, isAmoEnabled: Boolean, preProvidedBrokers: ReadableArray, promise: Promise) {
28-
2928
try {
3029
val brokerList = ArrayList<String>()
3130
for (index in 0 until preProvidedBrokers.size()) {
@@ -38,6 +37,11 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte
3837
val protocol = getProtocol(envName)
3938

4039
val env = Environment(gateway = gateway, buildType = protocol, isAmoEnabled = isAmoEnabled, preProvidedBrokers = brokerList, isLeprachaunActive = isLeprechaunActive)
40+
41+
// Set userIdentification if provided - For Now, we are not accepting this on Gateway SDK
42+
// if (!userId.isNullOrEmpty()) {
43+
// env.userId = userIdentification
44+
// }
4145

4246
SmallcaseGatewaySdk.setConfigEnvironment(environment = env, smallcaseGatewayListeners = object : SmallcaseGatewayListeners {
4347
override fun onGatewaySetupSuccessfull() {
@@ -66,8 +70,9 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte
6670
}
6771

6872
@ReactMethod
69-
fun init(sdkToken: String, promise: Promise) {
70-
73+
fun init(sdkToken: String, externalMeta: ReadableMap?, promise: Promise) {
74+
// externalMeta is accepted but not used on Android (iOS only feature)
75+
// Extract externalIdentifier if needed in future
7176
val initReq = InitRequest(sdkToken)
7277
SmallcaseGatewaySdk.init(authRequest = initReq, gatewayInitialisationListener = object : DataListener<InitialisationResponse> {
7378
override fun onFailure(errorCode: Int, errorMessage: String, data: String?) {

ios/SmallcaseGateway.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject)
5353
isLeprechaunActive:isLeprechaunActive
5454
isAmoEnabled:isAmoEnabled];
5555

56-
[SCGateway.shared setupWithConfig: config completion:^(BOOL success,NSError * error) {
56+
[SCGateway.shared setupWithConfig:config completion:^(BOOL success, NSError *error) {
5757
if(success) {
5858
resolve(@(YES));
5959
} else {
@@ -65,16 +65,19 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject)
6565

6666
reject(@"setConfigEnvironment", @"Env setup failed", err);
6767
}
68-
6968
}];
7069
}
7170

7271
//MARK: SDK init
7372
RCT_REMAP_METHOD(init,
7473
sdkToken:(NSString *)sdkToken
74+
externalMeta:(NSDictionary *)externalMeta
7575
initWithResolver:(RCTPromiseResolveBlock)resolve
7676
rejecter:(RCTPromiseRejectBlock)reject) {
77-
[SCGateway.shared initializeGatewayWithSdkToken:sdkToken completion:^(BOOL success, NSError * error) {
77+
78+
[SCGateway.shared initializeGatewayWithSdkToken:sdkToken
79+
externalMeta:externalMeta
80+
completion:^(BOOL success, NSError *error) {
7881
if(success) {
7982
resolve(@(YES));
8083
} else {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-smallcase-gateway",
33
"title": "React Native Smallcase Gateway",
4-
"version": "7.0.0",
4+
"version": "7.0.1",
55
"description": "smallcase gateway bindings for react native",
66
"main": "src/index.js",
77
"files": [

react-native-smallcase-gateway.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Pod::Spec.new do |s|
3333
s.dependency "ReactCommon/turbomodule/core"
3434
end
3535

36-
s.dependency 'SCGateway', '7.0.0'
36+
s.dependency 'SCGateway', '7.0.1'
3737
s.dependency 'SCLoans', '6.0.2'
3838
end

smart_investing_react_native/app/apis/Functions.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ async function setEnvironment(
7373
}
7474
const initGatewayResponse = await SmallcaseGateway.init(
7575
authJwtResult.authJwt,
76+
{
77+
externalIdentifier: {
78+
userId: "testValue", // Replace with actual userId if needed
79+
},
80+
},
7681
);
7782
console.log('initGatewayResponse: ' + initGatewayResponse);
7883
alert('Set Environment', 'Successful!!');
@@ -94,6 +99,7 @@ async function connect(env: Environment, userId: string): Promise<Boolean> {
9499
null,
95100
null,
96101
);
102+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.connect}`);
97103
console.log('transactionId: ' + transactionId);
98104
const transactionResponse = await SmallcaseGateway.triggerTransaction(
99105
transactionId,
@@ -123,6 +129,7 @@ async function connect(env: Environment, userId: string): Promise<Boolean> {
123129

124130
async function triggerMftxn(env: Environment, transactionId: string) {
125131
try {
132+
console.log(`Transaction ID: ${transactionId}, Intent: MF_HOLDINGS_IMPORT`);
126133
console.log('triggerMftxn txn id: ' + transactionId);
127134
const res = await SmallcaseGateway.triggerMfTransaction(transactionId);
128135
console.log('triggerMftxn res: ' + JSON.stringify(res));
@@ -148,6 +155,7 @@ async function placeSstOrder(
148155
null,
149156
null,
150157
);
158+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.transaction}`);
151159
console.log('sst txn id: ' + transactionId);
152160
const res = await SmallcaseGateway.triggerTransaction(transactionId, {
153161
test: 'test',
@@ -180,6 +188,7 @@ async function authorizeHoldings(env: Environment, userId: string) {
180188
null,
181189
null,
182190
);
191+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.authorizeHoldings}`);
183192
console.log('authorizeHoldings txn id: ' + transactionId);
184193
const res = await SmallcaseGateway.triggerTransaction(transactionId, {
185194
test: 'test',
@@ -204,6 +213,7 @@ async function reconcileHoldings(env: Environment, userId: string) {
204213
null,
205214
null,
206215
);
216+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.transaction} (RECONCILIATION)`);
207217
const res = await SmallcaseGateway.triggerTransaction(transactionId);
208218
console.log('reconcileHoldings res: ' + JSON.stringify(res));
209219
alert('Reconcile Holdings', JSON.stringify(res));
@@ -238,6 +248,7 @@ async function importHoldings(
238248
assetConfig,
239249
null,
240250
);
251+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.holdingsImport}`);
241252
console.log('importHoldings txn id: ' + transactionId);
242253
const res = await SmallcaseGateway.triggerTransaction(transactionId, {
243254
test: 'test',
@@ -396,6 +407,7 @@ async function fetchFunds(env: Environment, userId: string): Promise<number> {
396407
null,
397408
null,
398409
);
410+
console.log(`Transaction ID: ${transactionId}, Intent: ${transactionType.fetchFunds}`);
399411
console.log('fetchFunds txn id: ' + transactionId);
400412
const res = await SmallcaseGateway.triggerTransaction(transactionId, {
401413
test: 'test',
@@ -504,6 +516,7 @@ async function logout() {
504516

505517
async function triggerTxn(txnId: string) {
506518
try {
519+
console.log(`Transaction ID: ${txnId}, Intent: MANUAL_TRIGGER`);
507520
const res = await SmallcaseGateway.triggerTransaction(txnId, {
508521
test: 'test',
509522
});

src/SmallcaseGateway.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ const setConfigEnvironment = async (envConfig) => {
8585
*
8686
* note: this must be called after `setConfigEnvironment()`
8787
* @param {string} sdkToken
88+
* @param {Object} [externalMeta] - external metadata (iOS only, optional)
89+
* @param {Object} [externalMeta.externalIdentifier] - key-value pairs for external identifiers (e.g., { userId: '123' })
8890
*/
89-
const init = async (sdkToken) => {
91+
const init = async (sdkToken, externalMeta) => {
9092
const safeToken = typeof sdkToken === 'string' ? sdkToken : '';
91-
return SmallcaseGatewayNative.init(safeToken);
93+
const safeExternalMeta = externalMeta && typeof externalMeta === 'object' ? externalMeta : null;
94+
95+
return SmallcaseGatewayNative.init(safeToken, safeExternalMeta);
9296
};
9397

9498
/**

src/__tests__/init.test.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,32 @@ describe('init', () => {
88

99
test('valid', async () => {
1010
await SmallcaseGateway.init('test-token');
11-
expect(initFn).toHaveBeenNthCalledWith(1, 'test-token');
11+
expect(initFn).toHaveBeenNthCalledWith(1, 'test-token', null);
12+
});
13+
14+
test('valid with externalMeta', async () => {
15+
const externalMeta = {
16+
externalIdentifier: {
17+
userId: 'user123'
18+
}
19+
};
20+
await SmallcaseGateway.init('test-token', externalMeta);
21+
expect(initFn).toHaveBeenNthCalledWith(2, 'test-token', externalMeta);
1222
});
1323

1424
test('empty', async () => {
1525
await SmallcaseGateway.init();
16-
expect(initFn).toHaveBeenNthCalledWith(2, '');
26+
expect(initFn).toHaveBeenNthCalledWith(3, '', null);
1727
});
1828

1929
test('invalid', async () => {
2030
await SmallcaseGateway.init(undefined);
21-
expect(initFn).toHaveBeenNthCalledWith(3, '');
31+
expect(initFn).toHaveBeenNthCalledWith(4, '', null);
2232

23-
await SmallcaseGateway.init({});
24-
expect(initFn).toHaveBeenNthCalledWith(4, '');
33+
await SmallcaseGateway.init('test-token', {});
34+
expect(initFn).toHaveBeenNthCalledWith(5, 'test-token', {});
2535

2636
await SmallcaseGateway.init(123);
27-
expect(initFn).toHaveBeenNthCalledWith(5, '');
37+
expect(initFn).toHaveBeenNthCalledWith(6, '', null);
2838
});
2939
});

0 commit comments

Comments
 (0)