From 1cf26a95f1ddc604c897a77c633bb19276a8b99a Mon Sep 17 00:00:00 2001 From: Dhruv Porwal Date: Mon, 5 Jan 2026 16:05:07 +0530 Subject: [PATCH 1/4] build(iOS): v+ scg: 7.0.0 --- scgateway/ios/scgateway_flutter_plugin.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scgateway/ios/scgateway_flutter_plugin.podspec b/scgateway/ios/scgateway_flutter_plugin.podspec index af78993..351bee2 100644 --- a/scgateway/ios/scgateway_flutter_plugin.podspec +++ b/scgateway/ios/scgateway_flutter_plugin.podspec @@ -15,7 +15,7 @@ Scgateway Flutter plugin. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.dependency 'SCGateway', '6.1.1' + s.dependency 'SCGateway', '7.0.0' s.xcconfig = {'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES'} s.vendored_frameworks = 'SCGateway.xcframework' s.platform = :ios, '13.0' From 92545b09f4d5fcf98c4d5546203fc67195a6a61b Mon Sep 17 00:00:00 2001 From: Dhruv Porwal Date: Mon, 5 Jan 2026 16:05:51 +0530 Subject: [PATCH 2/4] build(android): v+ scg: 6.0.0 --- scgateway/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scgateway/android/build.gradle b/scgateway/android/build.gradle index 56e2703..1e661c6 100644 --- a/scgateway/android/build.gradle +++ b/scgateway/android/build.gradle @@ -64,5 +64,5 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.smallcase.gateway:sdk:5.0.1' + implementation 'com.smallcase.gateway:sdk:6.0.0' } From f4476a983ed0161be05dc4abe43d20d380f7ccfa Mon Sep 17 00:00:00 2001 From: Dhruv Porwal Date: Tue, 6 Jan 2026 01:38:13 +0530 Subject: [PATCH 3/4] feat: Add userInfo support to SmallPlug launch methods Extract and include userInfo (number, countryCode) in SmallPlug response for both launchSmallplug and launchSmallplugWithBranding methods. - iOS: Handle SmallPlugResult class instead of String response - Android: Structure response with userInfo in data object - Both: Consistent response format matching React Native SDK Response format: {success, smallcaseAuthToken, data: {userInfo: {...}}} --- .../ScgatewayFlutterPlugin.kt | 58 ++++- .../Classes/SwiftScgatewayFlutterPlugin.swift | 198 +++++++++++++++++- scgateway/lib/scgateway_flutter_plugin.dart | 22 ++ 3 files changed, 268 insertions(+), 10 deletions(-) diff --git a/scgateway/android/src/main/kotlin/com/example/scgateway_flutter_plugin/ScgatewayFlutterPlugin.kt b/scgateway/android/src/main/kotlin/com/example/scgateway_flutter_plugin/ScgatewayFlutterPlugin.kt index d5dd4ec..16fd480 100644 --- a/scgateway/android/src/main/kotlin/com/example/scgateway_flutter_plugin/ScgatewayFlutterPlugin.kt +++ b/scgateway/android/src/main/kotlin/com/example/scgateway_flutter_plugin/ScgatewayFlutterPlugin.kt @@ -351,7 +351,34 @@ class ScgatewayFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { override fun onSuccess(smallPlugResult: SmallPlugResult) { uiThreadHandler.post { - result.success(Gson().toJson(smallPlugResult).toString()) + val responseDict = JSONObject() + responseDict.put("success", true) + + if (smallPlugResult.smallcaseAuthToken != null) { + responseDict.put("smallcaseAuthToken", smallPlugResult.smallcaseAuthToken) + } + + // Add userInfo inside data object if available + smallPlugResult.userInfo?.let { userInfo -> + val dataDict = JSONObject() + val userInfoDict = JSONObject() + + // number and countryCode are optional + userInfo.number?.let { + userInfoDict.put("number", it) + } + userInfo.countryCode?.let { + userInfoDict.put("countryCode", it) + } + + // Only add userInfo if it has at least one field + if (userInfoDict.length() > 0) { + dataDict.put("userInfo", userInfoDict) + responseDict.put("data", dataDict) + } + } + + result.success(responseDict.toString()) } } @@ -381,7 +408,34 @@ class ScgatewayFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { override fun onSuccess(smallPlugResult: SmallPlugResult) { uiThreadHandler.post { - result.success(Gson().toJson(smallPlugResult).toString()) + val responseDict = JSONObject() + responseDict.put("success", true) + + if (smallPlugResult.smallcaseAuthToken != null) { + responseDict.put("smallcaseAuthToken", smallPlugResult.smallcaseAuthToken) + } + + // Add userInfo inside data object if available + smallPlugResult.userInfo?.let { userInfo -> + val dataDict = JSONObject() + val userInfoDict = JSONObject() + + // number and countryCode are optional + userInfo.number?.let { + userInfoDict.put("number", it) + } + userInfo.countryCode?.let { + userInfoDict.put("countryCode", it) + } + + // Only add userInfo if it has at least one field + if (userInfoDict.length() > 0) { + dataDict.put("userInfo", userInfoDict) + responseDict.put("data", dataDict) + } + } + + result.success(responseDict.toString()) } } diff --git a/scgateway/ios/Classes/SwiftScgatewayFlutterPlugin.swift b/scgateway/ios/Classes/SwiftScgatewayFlutterPlugin.swift index d8f5733..91e5c81 100644 --- a/scgateway/ios/Classes/SwiftScgatewayFlutterPlugin.swift +++ b/scgateway/ios/Classes/SwiftScgatewayFlutterPlugin.swift @@ -579,10 +579,57 @@ public class SwiftScgatewayFlutterPlugin: NSObject, FlutterPlugin { SCGateway.shared.launchSmallPlug(presentingController: currentViewController, smallplugData: SmallplugData(target, params), completion: { response, error in - if let smallplugResponse = response { + if let error = error { + let res = NSMutableDictionary() + res.setValue(false, forKey: "success") - result(self.getJsonStringResult(success: true, data: smallplugResponse as? String, errorCode: nil, errorMessage: nil, transaction: nil)) + var errorMessage = error.localizedDescription + if let objcError = error as? ObjcTransactionError { + errorMessage = objcError.domain + } + + res.setValue(errorMessage, forKey: "error") + + let jsonData = try! JSONSerialization.data(withJSONObject: res, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + + result(FlutterError.init(code: jsonString ?? "", message: nil, details: nil)) + return + } + + if let smallplugResult = response as? SmallPlugResult { + var responseDict = NSMutableDictionary() + responseDict.setValue(true, forKey: "success") + + if let authToken = smallplugResult.smallcaseAuthToken { + responseDict.setValue(authToken, forKey: "smallcaseAuthToken") + } + + // Add userInfo inside data object if available + if let userInfo = smallplugResult.userInfo { + let dataDict = NSMutableDictionary() + let userInfoDict = NSMutableDictionary() + + // number and countryCode are NON-OPTIONAL Strings + if !userInfo.number.isEmpty { + userInfoDict.setValue(userInfo.number, forKey: "number") + } + + if !userInfo.countryCode.isEmpty { + userInfoDict.setValue(userInfo.countryCode, forKey: "countryCode") + } + + // Only add userInfo if it has at least one field + if userInfoDict.count > 0 { + dataDict.setValue(userInfoDict, forKey: "userInfo") + responseDict.setValue(dataDict, forKey: "data") + } + } + + let jsonData = try! JSONSerialization.data(withJSONObject: responseDict, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + result(jsonString) } }) @@ -591,10 +638,58 @@ public class SwiftScgatewayFlutterPlugin: NSObject, FlutterPlugin { SCGateway.shared.launchSmallPlug(presentingController: currentViewController, smallplugData: nil, completion: { response, error in - if let smallplugResponse = response { + if let error = error { + let res = NSMutableDictionary() + res.setValue(false, forKey: "success") + + var errorMessage = error.localizedDescription + if let objcError = error as? ObjcTransactionError { + errorMessage = objcError.domain + } + + res.setValue(errorMessage, forKey: "error") + + let jsonData = try! JSONSerialization.data(withJSONObject: res, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + + result(FlutterError.init(code: jsonString ?? "", message: nil, details: nil)) + return + } + + if let smallplugResult = response as? SmallPlugResult { + var responseDict = NSMutableDictionary() + responseDict.setValue(true, forKey: "success") + + if let authToken = smallplugResult.smallcaseAuthToken { + responseDict.setValue(authToken, forKey: "smallcaseAuthToken") + } + + // Add userInfo inside data object if available + if let userInfo = smallplugResult.userInfo { + let dataDict = NSMutableDictionary() + let userInfoDict = NSMutableDictionary() + + // number and countryCode are NON-OPTIONAL Strings + if !userInfo.number.isEmpty { + userInfoDict.setValue(userInfo.number, forKey: "number") + } + + if !userInfo.countryCode.isEmpty { + userInfoDict.setValue(userInfo.countryCode, forKey: "countryCode") + } + + // Only add userInfo if it has at least one field + if userInfoDict.count > 0 { + dataDict.setValue(userInfoDict, forKey: "userInfo") + responseDict.setValue(dataDict, forKey: "data") + } + } + - result(self.getJsonStringResult(success: true, data: smallplugResponse as? String, errorCode: nil, errorMessage: nil, transaction: nil)) + let jsonData = try! JSONSerialization.data(withJSONObject: responseDict, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + result(jsonString) } }) @@ -639,10 +734,49 @@ public class SwiftScgatewayFlutterPlugin: NSObject, FlutterPlugin { completion: { response, error in - if let smallplugResponse = response { + if let error = error { + let res = NSMutableDictionary() + res.setValue(false, forKey: "success") + + var errorMessage = error.localizedDescription + if let objcError = error as? ObjcTransactionError { + errorMessage = objcError.domain + } + + res.setValue(errorMessage, forKey: "error") + + let jsonData = try! JSONSerialization.data(withJSONObject: res, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + + result(FlutterError.init(code: jsonString ?? "", message: nil, details: nil)) + return + } + + if let smallplugResult = response as? SmallPlugResult { + var responseDict = NSMutableDictionary() + responseDict.setValue(true, forKey: "success") - result(self.getJsonStringResult(success: true, data: smallplugResponse as? String, errorCode: nil, errorMessage: nil, transaction: nil)) + if let authToken = smallplugResult.smallcaseAuthToken { + responseDict.setValue(authToken, forKey: "smallcaseAuthToken") + } + // Add userInfo inside data object if available + if let userInfo = smallplugResult.userInfo { + let dataDict = NSMutableDictionary() + let userInfoDict = NSMutableDictionary() + + // number and countryCode are not optional in SmallPlugUserInfo + userInfoDict.setValue(userInfo.number, forKey: "number") + userInfoDict.setValue(userInfo.countryCode, forKey: "countryCode") + + dataDict.setValue(userInfoDict, forKey: "userInfo") + responseDict.setValue(dataDict, forKey: "data") + } + + let jsonData = try! JSONSerialization.data(withJSONObject: responseDict, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + + result(jsonString) } }) @@ -651,10 +785,58 @@ public class SwiftScgatewayFlutterPlugin: NSObject, FlutterPlugin { SCGateway.shared.launchSmallPlug(presentingController: currentViewController, smallplugData: nil, completion: { response, error in - if let smallplugResponse = response { + if let error = error { + let res = NSMutableDictionary() + res.setValue(false, forKey: "success") + + var errorMessage = error.localizedDescription + if let objcError = error as? ObjcTransactionError { + errorMessage = objcError.domain + } + + res.setValue(errorMessage, forKey: "error") + + let jsonData = try! JSONSerialization.data(withJSONObject: res, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + + result(FlutterError.init(code: jsonString ?? "", message: nil, details: nil)) + return + } + + if let smallplugResult = response as? SmallPlugResult { + var responseDict = NSMutableDictionary() + responseDict.setValue(true, forKey: "success") + + if let authToken = smallplugResult.smallcaseAuthToken { + responseDict.setValue(authToken, forKey: "smallcaseAuthToken") + } + + // Add userInfo inside data object if available + if let userInfo = smallplugResult.userInfo { + let dataDict = NSMutableDictionary() + let userInfoDict = NSMutableDictionary() + + // number and countryCode are NON-OPTIONAL Strings + if !userInfo.number.isEmpty { + userInfoDict.setValue(userInfo.number, forKey: "number") + } + + if !userInfo.countryCode.isEmpty { + userInfoDict.setValue(userInfo.countryCode, forKey: "countryCode") + } + + // Only add userInfo if it has at least one field + if userInfoDict.count > 0 { + dataDict.setValue(userInfoDict, forKey: "userInfo") + responseDict.setValue(dataDict, forKey: "data") + } + } + - result(self.getJsonStringResult(success: true, data: smallplugResponse as? String, errorCode: nil, errorMessage: nil, transaction: nil)) + let jsonData = try! JSONSerialization.data(withJSONObject: responseDict, options: []) + let jsonString = String(data: jsonData, encoding: .utf8) + result(jsonString) } }) diff --git a/scgateway/lib/scgateway_flutter_plugin.dart b/scgateway/lib/scgateway_flutter_plugin.dart index b9e776c..df4efab 100644 --- a/scgateway/lib/scgateway_flutter_plugin.dart +++ b/scgateway/lib/scgateway_flutter_plugin.dart @@ -288,6 +288,17 @@ class ScgatewayFlutterPlugin { return logoutResponse; } + /// Launches SmallPlug and returns a JSON string with the following structure: + /// { + /// "success": true, + /// "smallcaseAuthToken": "token", // optional + /// "data": { + /// "userInfo": { + /// "number": "1234567890", // optional + /// "countryCode": "+91" // optional + /// } + /// } + /// } static Future launchSmallplug(SmallplugData smallplugData) async { String? smallplugResponse; @@ -306,6 +317,17 @@ class ScgatewayFlutterPlugin { return smallplugResponse; } + /// Launches SmallPlug with custom branding and returns a JSON string with the following structure: + /// { + /// "success": true, + /// "smallcaseAuthToken": "token", // optional + /// "data": { + /// "userInfo": { + /// "number": "1234567890", // optional + /// "countryCode": "+91" // optional + /// } + /// } + /// } static Future launchSmallplugWithBranding( SmallplugData smallplugData, {SmallplugUiConfig? smallplugUiConfig}) async { From 32286e7603e92bc6cb828a89befb17f872b40779 Mon Sep 17 00:00:00 2001 From: Dhruv Porwal Date: Tue, 6 Jan 2026 01:43:12 +0530 Subject: [PATCH 4/4] chore(prod): scg: 7.0.0, si: 3.0.2 --- scgateway/pubspec.yaml | 2 +- smart_investing/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scgateway/pubspec.yaml b/scgateway/pubspec.yaml index ffd6d66..e3d94b9 100644 --- a/scgateway/pubspec.yaml +++ b/scgateway/pubspec.yaml @@ -1,6 +1,6 @@ name: scgateway_flutter_plugin description: Scgateway Flutter plugin. -version: 6.0.1 +version: 7.0.0 homepage: https://github.com/smallcase/gw-mob-sdk-flutter # The following line prevents the package from being accidentally published to diff --git a/smart_investing/pubspec.yaml b/smart_investing/pubspec.yaml index 6bdb5b4..186f0a3 100644 --- a/smart_investing/pubspec.yaml +++ b/smart_investing/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 3.0.1 +version: 3.0.2 environment: sdk: ^3.8.1