diff --git a/CHANGELOG.md b/CHANGELOG.md index fc2644d3..038758b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,37 @@ 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. +### [7.6.2](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.6.1...v7.6.2) (2026-09-02) + +### [7.6.1](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.6.0...v7.6.1) (2026-08-17) + +### Improvements + +* **android:** update Loans SDK to 5.3.1 + +## [7.6.0](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.5.0...v7.6.0) (2026-07-31) + + +### Improvements + +* **android:** update Loans SDK to 5.3.0 + +### Bug Fixes + +* **android:** keep SCGateway classes for R8 ([e99d428](https://github.com/smallcase/react-native-smallcase-gateway/commit/e99d4284368827051a46a68f12e2dba75852ac3e)) + +## [7.5.0](https://npmjs.com/package/react-native-smallcase-gateway/v/7.5.0?activeTab=versions) (2026-07-10) + +Dev Improvements + +* Bumped Loans native SDK to the dark-theme internal release (Android 5.1.4-92, iOS 7.1.2-44) and dropped a stale ProGuard workaround while keeping R8 full mode on. + +Features + +* Added a `colorScheme` (`dark` / `light` / `system`) option to `ScLoanInfo`, letting partner apps control the LAS web UI theme instead of always defaulting to light. + +### [7.4.4](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.4.3...v7.4.4) (2026-06-11) + ### [7.4.3](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.4.0...v7.4.3) (2026-06-09) ### [7.4.2](https://github.com/smallcase/react-native-smallcase-gateway/compare/v7.4.0...v7.4.2) (2026-05-25) diff --git a/README.md b/README.md index 80a9d484..1e7341ff 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,9 @@ const res = await SmallcaseGateway.triggerTransaction(transactionId); // start lead generation flow SmallcaseGateway.triggerLeadGen({ email: "test@gmail.com" }); + +// launch a standalone WebView; setup/init are not required +await SmallcaseGateway.launchScWebView("https://www.smallcase.com"); ``` ## Debug / Contribution diff --git a/android/build.gradle b/android/build.gradle index 68bb5f72..6a15a205 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -149,8 +149,8 @@ def kotlin_version = getExtOrDefault('kotlinVersion') dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules - implementation 'com.smallcase.gateway:sdk:6.1.1' - implementation 'com.smallcase.loans:sdk-sourav-native-dark-theme-cb54bf9:5.1.4-92-release' + implementation 'com.smallcase.gateway:sdk:6.1.2' + implementation 'com.smallcase.loans:sdk:5.3.2' implementation "androidx.core:core-ktx:1.3.1" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt b/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt index c36f9a6e..d9629576 100644 --- a/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt +++ b/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt @@ -1,5 +1,6 @@ package com.reactnativesmallcasegateway +import android.net.Uri import android.util.Log import androidx.appcompat.app.AppCompatActivity import com.facebook.react.bridge.* @@ -163,6 +164,28 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte } } + @ReactMethod + fun launchScWebView(url: String, promise: Promise) { + val activity = reactApplicationContext.currentActivity ?: run { + promise.reject("no_activity", "No active Android activity") + return + } + val uri = Uri.parse(url) + if (uri.scheme?.lowercase() !in setOf("http", "https") || uri.host.isNullOrBlank()) { + promise.reject("invalid_url", "A valid absolute HTTP(S) URL is required") + return + } + + activity.runOnUiThread { + try { + SmallcaseGatewaySdk.launchScWebView(activity, url) + promise.resolve(true) + } catch (error: Exception) { + promise.reject("launch_failed", error) + } + } + } + @ReactMethod fun launchSmallplug(targetEndpoint: String, params: String, promise: Promise) { @@ -562,4 +585,3 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte } } - diff --git a/ios/SmallcaseGateway.m b/ios/SmallcaseGateway.m index fa04027c..46c60e4e 100644 --- a/ios/SmallcaseGateway.m +++ b/ios/SmallcaseGateway.m @@ -360,6 +360,27 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) } //MARK: smallplug +RCT_REMAP_METHOD(launchScWebView, + urlString:(NSString *)urlString + launchScWebViewWithResolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject) { + NSURL *url = [NSURL URLWithString:urlString]; + NSString *scheme = url.scheme.lowercaseString; + if (url == nil || url.host.length == 0 || + !([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])) { + reject(@"invalid_url", @"A valid absolute HTTP(S) URL is required", nil); + return; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + [SCGateway.shared + launchScWebViewWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] + url:url + completion:^(__unused id response, __unused NSError *error) {}]; + resolve(@(YES)); + }); +} + RCT_REMAP_METHOD(launchSmallplug, targetEndpoint:(NSString *)targetEndpoint params:(NSString *)params @@ -809,4 +830,3 @@ - (NSError *)scLoanErrorToDict:(ScLoanError *)error { } @end - diff --git a/package.json b/package.json index 26045bb4..53c766bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-smallcase-gateway", "title": "React Native Smallcase Gateway", - "version": "7.4.3", + "version": "7.6.2", "description": "smallcase gateway bindings for react native", "main": "src/index.js", "files": [ diff --git a/react-native-smallcase-gateway.podspec b/react-native-smallcase-gateway.podspec index 686d423d..607a40ca 100644 --- a/react-native-smallcase-gateway.podspec +++ b/react-native-smallcase-gateway.podspec @@ -35,7 +35,5 @@ Pod::Spec.new do |s| end s.dependency 'SCGateway', '7.2.0' - # INTERNAL TEST PIN: dark-theme branch build (mirrors the android/build.gradle pin). - # Revert to: s.dependency 'SCLoans', '7.2.0' - s.dependency 'SCLoans-sourav-native-dark-theme-37c97d9', '7.1.2-45-release' + s.dependency 'SCLoans', '7.3.0' end diff --git a/smart_investing_react_native/android/app/proguard-rules.pro b/smart_investing_react_native/android/app/proguard-rules.pro index 5dccbcd3..5924e582 100644 --- a/smart_investing_react_native/android/app/proguard-rules.pro +++ b/smart_investing_react_native/android/app/proguard-rules.pro @@ -12,6 +12,8 @@ # SCGateway proguard rules — keeping it here, same as loans. -keep class com.smallcase.gateway.** { *; } +-keep class com.example.** { *; } + # Retrofit + R8 full mode (AGP 8 default): generic signatures are stripped for # any type that is not kept, so ConfigService.getBrokerConfigs(): Call # degrades to a raw Call and Retrofit rejects it diff --git a/smart_investing_react_native/android/gradle.properties b/smart_investing_react_native/android/gradle.properties index 9767fbf1..6657b545 100644 --- a/smart_investing_react_native/android/gradle.properties +++ b/smart_investing_react_native/android/gradle.properties @@ -42,6 +42,3 @@ hermesEnabled=true artifactory_contextUrl=https\://artifactory.smallcase.com/artifactory artifactory_password=reactNativeUser123 artifactory_user=react_native_user - -# R8 full mode enabled — verified safe against loans SDK consumer-rules.pro -android.enableR8.fullMode=true \ No newline at end of file diff --git a/smart_investing_react_native/app/screens/SmtScreen.tsx b/smart_investing_react_native/app/screens/SmtScreen.tsx index f2998d68..87d17507 100644 --- a/smart_investing_react_native/app/screens/SmtScreen.tsx +++ b/smart_investing_react_native/app/screens/SmtScreen.tsx @@ -1,9 +1,14 @@ import React from 'react'; -import {Button, TextInput, View} from 'react-native'; +import {Button, ScrollView, TextInput} from 'react-native'; import {launchSmallPlug} from '../apis/Functions'; -import {SCGatewayEventManager} from 'react-native-smallcase-gateway'; +import SmallcaseGateway, { + SCGatewayEventManager, +} from 'react-native-smallcase-gateway'; const SmtScreen = () => { + const [webViewUrl, onChangeWebViewUrl] = React.useState( + 'https://www.smallcase.com', + ); const [targetEndpoint, onChangeTargetEndpoint] = React.useState< string | null >(null); @@ -21,7 +26,7 @@ const SmtScreen = () => { string | null >(null); return ( - + { @@ -99,7 +104,24 @@ const SmtScreen = () => { title={'SmallPlug'} accessibilityLabel="Learn more about this purple button" /> - + +