feat: support multiple HyperServices instances - #193
Merged
Conversation
Yaswanth0606
force-pushed
the
multi-instance-core
branch
4 times, most recently
from
August 24, 2026 13:25
3d069f5 to
4141008
Compare
namitgoelpj
approved these changes
Aug 24, 2026
Yaswanth0606
force-pushed
the
multi-instance-core
branch
3 times, most recently
from
August 25, 2026 09:58
2d1e0ac to
d239282
Compare
Adds a HyperServiceInstance class that creates independent, keyed HyperServices objects alongside the existing module-wide singleton API, each with its own event channel. This PR covers the core integration: create, initiate, process, terminate, back-press and status helpers. Merchant views, HyperFragmentView and processWithActivity/openPaymentPage per instance follow in a separate PR. JS: - HyperServiceInstance: constructor(tenantId?, clientId?), initiate, process, terminate, onBackPressed, isNull, isInitialised and getHyperEventString() as the instance's event channel - lazy linking error; platform guards for iOS-only gaps Android: - keyed create/initiate/process/terminate/back-press/isInitialised with per-key event emission - permission and activity results forwarded to every live instance - invalidate() terminates and clears keyed state on React reloads - every skipped call logged to logcat alongside SdkTracker telemetry - legacy single-instance API behaviour preserved exactly - resolve ReactHost reflectively so the module compiles on RN < 0.74 - fix rnVersion Groovy scoping crash for newArchEnabled=false consumers iOS: - keyed methods mirrored with per-key delegate retention, dynamic supportedEvents, synchronized dict access, and invalidate cleanup - podspec: RN version detection for development layouts; folly compiler flags applied Example app: - toolchain modernized: React Native 0.79.7 (react 19), AGP 8.9 via RNGP, Gradle 8.13, compileSdk 36, Kotlin 2.0.21, RN 0.79 Podfile, Flipper removed; Jetifier re-enabled for the Juspay micro-SDKs with RN AARs on the ignorelist - demo flows for multiple instances: create/select instances, initiate, process and terminate per instance with per-instance event listeners - generateSign accepts PKCS#8/PKCS#1 keys with or without PEM armor on both platforms, with errors surfaced in the UI Docs: - README section covering merchant integration for multiple instances Co-authored-by: Anurag Singh <as6003688@gmail.com> Co-authored-by: yuvrajjsingh0 <yuvraj.singh@juspay.in>
Yaswanth0606
force-pushed
the
multi-instance-core
branch
from
August 25, 2026 10:41
d239282 to
96de1ca
Compare
balaganesh-juspay
approved these changes
Aug 25, 2026
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
Adds a
HyperServiceInstanceclass so an app can run multiple independent HyperServices instances (e.g. several tenants/clients in one session) alongside the existing module-wide singleton API, which is preserved exactly.What's included
HyperServiceInstance(create / initiate / process / processWithActivity / openPaymentPage / terminate / onBackPressed / isNull / isInitialised / per-instance merchant views /getHyperEventString),HyperFragmentViewinstanceprop, lazy linking error, platform guardsProcessActivitycallbacks and back-press routing, per-instance merchant views with process-wide fallback, permission/activity-result fan-out to all live instances,invalidate()cleanup on reloads, logcat logging for every skipped call, thread-safe keyed mapsSdkDelegatelifecycle, dynamicsupportedEvents, synchronized dict access,invalidatecleanupext.rnVersionGroovy scoping crash (brokenewArchEnabled=falseconsumers), reflectiveReactHost(compiles on RN < 0.74), podspec RN-version detection + folly compiler flagsVerification
session_metadataon the instance channel) → process → payment page rendered → terminate, zero crashesFollow-up PR (stacked): example app modernization + multi-instance demo flows.
🤖 Generated with Claude Code