feat: add native SDK debug mode switch - #209
Closed
DeepakSingh80 wants to merge 14 commits into
Closed
DeepakSingh80 wants to merge 14 commits into
DeepakSingh80 wants to merge 14 commits into
Conversation
Release/v7.4.4
* bump Loans SDK to dark-theme internal release (Android 5.1.4-91, iOS … (#195) * bump Loans SDK to dark-theme internal release (Android 5.1.4-91, iOS 7.1.2-44) * chore(loans): bump loans SDK pin to sdk-sourav-native-dark-theme-cb54bf9 (5.1.4-92-release) * fix(proguard): drop stale loans repackage workaround, keep R8 full mode on * chore: update Loans native SDK dependencies * chore(release): 7.5.0 * chore: use default R8 mode in sample app * chore(android): bump Loans SDK to 5.3.0 * fix(android): keep SCGateway classes for R8 * docs(changelog): document v7.5.0 changes * chore(release): 7.6.0
# Conflicts: # android/build.gradle # react-native-smallcase-gateway.podspec # smart_investing_react_native/android/app/proguard-rules.pro # smart_investing_react_native/android/gradle.properties # smart_investing_react_native/ios/Podfile.lock # smart_investing_react_native/yarn.lock
chore(android): bump Loans SDK to 5.3.1
* chore(android): bump Loans SDK to 5.3.2 * chore(release): 7.6.2
* feat: add Loans KYC permission usage descriptions * chore: bump SCLoans iOS SDK to 7.4.0 * chore(release): 7.7.0
* feat: expose webview-as-a-service * chore: update native SDK release dependencies * chore(release): 7.7.1
* chore(loans): update native SDK release dependencies * chore(release): 7.7.2 * chore(native): update gateway SDKs * chore(loans): use production native SDKs * docs(release): clarify production dependencies * docs(release): list native SDK versions
Move the native Gateway and Loans SDK pins into native-sdk.json with release and debug entries. Host apps opt into debug builds of the native SDKs with SmallcaseGateway_sdkMode=debug (Android) or SMALLCASE_SDK_MODE=debug pod install (iOS); release stays the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets host apps switch the RN wrapper to debug builds of the native Gateway/Loans SDKs (WebView inspection, debug logging) without a separate branch or npm release.
Background
This package is a bridge between a React Native app's JavaScript and the native Gateway and Loans SDKs, which exist separately for Android and iOS. The package doesn't bundle those SDKs. It declares them as dependencies, which Gradle (Android) and CocoaPods (iOS) download when the host app builds.
Until now the dependency list was hardcoded to the release SDKs. Debugging an issue inside a native SDK meant hand-editing the pins on a separate branch (the "INTERNAL TEST PIN" commits).
Changes
native-sdk.json, withrelease(default, unchanged: Android 6.1.4 / 5.4.0, iOS SCGateway 7.2.2 / SCLoans 7.5.0) anddebugentries.android/build.gradlereads the pins. Opt in withSmallcaseGateway_sdkMode=debugin the host'sgradle.properties.SMALLCASE_SDK_MODE=debug pod install, withcocoapodspec-internaladded as a Podfile source.native-sdk.jsonis added tofilesso it ships in the npm package.How release and debug work separately
There is one npm package and one codebase. Release and debug differ only in which native SDK versions get downloaded, and the host app picks one at build / install time:
android/build.gradleand CocoaPods evaluates the podspec onpod install.native-sdk.jsonand looks for the mode flag. If the flag is missing, the mode isrelease.SCGateway-internal(Android) orcocoapodspec-internal(iOS). This path is only taken when someone opts in, so the published package never makes customers resolve internal artifacts.null, the build stops with an explicit error instead of silently falling back.The mode is set per project / per
pod install, not per Debug/Release build variant of the host app. That keeps Android and iOS behaving the same.How to use debug mode
Requires internal access: Artifactory
SCGateway-internalfor Android, and SSH access tosmallcase/cocoapodspec-internalfor iOS.Android
android/gradle.properties, add:SmallcaseGateway_sdkMode=debugnpx react-native run-android). Gradle now resolves the debug SDKs.iOS
ios/Podfile, add:iosfolder, run:pod install.Things to know before relying on it
debugpin innative-sdk.jsonis stillnull, so turning on debug mode fails with the "no SDK pinned" error until real debug versions are filled in.gw-mob-iosBuildScripts/phases/create-xc-framework.sharchives without-configuration, so it always builds Release. A real debug xcframework needs-configuration Debugthere plus a CI run.sdkMode=debugis left ingradle.properties, release APKs also get the debug SDK. On iOS, the mode from the lastpod installstays in effect. Switch back before building for the Play Store / App Store.Follow-ups
debugpins with published internal debug versions.-configuration Debugto the xcframework build ingw-mob-iosand publish a debug pod.debugImplementation <debug pin>/releaseImplementation <release pin>on Android in debug mode, so a release build can never pick up the debug SDK.ENV['SMALLCASE_SDK_MODE'] = 'debug'at the top of the Podfile, so teammates and CI don't depend on remembering the env var.development.Test plan
pod ipc spec: release mode resolves to the same SDK versions as before; debug mode with sample pins resolves to them; unpinned or unknown modes error out.🤖 Generated with Claude Code