Skip to content

chore(example): modernize example app and demo the multi-instance API - #194

Open
Yaswanth0606 wants to merge 2 commits into
mainfrom
multi-instance-example-upgrade
Open

chore(example): modernize example app and demo the multi-instance API#194
Yaswanth0606 wants to merge 2 commits into
mainfrom
multi-instance-example-upgrade

Conversation

@Yaswanth0606

Copy link
Copy Markdown
Contributor

Summary

Stacked on #193 — merge that first, then retarget/merge this.

Modernizes the example app toolchain and adds the demo flows for the multiple-HyperServices-instances API:

  • React Native 0.79.7 (react 19), AGP 8.9 via RNGP, Gradle 8.13
  • Android: compileSdk 36, targetSdk 35, minSdk 24, NDK 27.1, Kotlin 2.0.21
  • Jetifier re-enabled (Juspay micro-SDKs still reference android.support.*; without it the SDK crashes with NoClassDefFoundError when spawning services) with react-android/hermes-android on the ignorelist
  • iOS: RN 0.79 Podfile, bundleURL AppDelegate, folly flags in the app target, min iOS 15.1
  • generateSign accepts PKCS#8 and PKCS#1 keys, with or without PEM armor, on both platforms, with descriptive errors surfaced as alerts (previously: Android crashed on PEM input, iOS could not parse PKCS#8 at all)
  • Demo flows are fully instance-aware: create/select/terminate instances, keyed initiate/process, per-instance back-press, fragment-view binding, merchant views routed via an activeInstance holder
  • Flipper removed (dropped by React Native itself)

Verification

  • Android: built and run on an emulator (SDK 36) — instance create → initiate (real SDK boot) → process → payment page rendered, zero crashes
  • iOS: pods install with correct RN detection, xcodebuild succeeds, app runs on an iPhone 16 Pro simulator with the keyed flow exercised
  • tsc / eslint / jest green on the full tree

🤖 Generated with Claude Code

@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from 93377f3 to a487798 Compare August 24, 2026 12:57
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from a487798 to f6ee21e Compare August 24, 2026 13:03
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from f6ee21e to 71fe3ad Compare August 24, 2026 13:10
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from 71fe3ad to 1187e1e Compare August 24, 2026 13:25
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from 1187e1e to 2f696fc Compare August 24, 2026 14:17
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from 2f696fc to 5e5084a Compare August 25, 2026 09:53
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from 5e5084a to adf1438 Compare August 25, 2026 09:59
Yaswanth Polisetti and others added 2 commits August 25, 2026 16:10
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>
Extends multiple-HyperServices-instances support with the advanced
surfaces deferred from the core PR:

- processWithActivity per instance: ProcessActivity callbacks keyed by
  instance with per-key back-press routing and teardown
- openPaymentPage per instance with results on the instance's channel
- per-instance merchant view registration
  (notifyAboutRegisterComponent(viewType, componentName)) with
  process-wide fallback, and per-instance updateMerchantViewHeight on iOS
- instance-aware HyperFragmentView via an instance prop on both
  platforms and architectures, with per-view props state fixing the
  shared-fields clobbering and double-process issues
- example app demonstrates the new surfaces (instance-bound fragment
  view, merchant views routed via activeInstance, per-instance
  process-with-activity)
- README: merchant views per instance, HyperFragmentView per instance,
  and updated limitations
@Yaswanth0606
Yaswanth0606 force-pushed the multi-instance-example-upgrade branch from adf1438 to c3a048c Compare August 25, 2026 10:41
Base automatically changed from multi-instance-core to main August 25, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant