Repository navigation
fix: merchant views on the New Architecture below RN 0.82 - #198
Merged
Merged
Conversation
Yaswanth0606
force-pushed
the
fix/merchant-views-new-arch
branch
from
October 24, 2026 08:56
784e860 to
621e429
Compare
Android: below RN 0.82, createMerchantView called getReactNativeHost().getReactInstanceManager() before checking IS_NEW_ARCHITECTURE_ENABLED, so bridgeless apps whose ReactNativeHost throws there never got merchant views, and the stock host built an unused legacy ReactInstanceManager. New Architecture builds now always use the ReactHost.createSurface path with the activity context; createReactSurfaceView is removed. iOS: the RCTReactNativeFactory lookup only checked HyperSdkReactDelegate and ivars declared on the app delegate's own class, so RCTAppDelegate subclasses fell back to RCTRootView initWithBridge:, which renders nothing in bridgeless mode. Also ask the delegate for reactNativeFactory, and declare the runtime-resolved selectors so -Wundeclared-selector stays quiet. README: document newArchEnabled for Android below RN 0.82 and how merchant views find the ReactHost and RCTReactNativeFactory on the New Architecture.
Yaswanth0606
force-pushed
the
fix/merchant-views-new-arch
branch
from
October 24, 2026 16:22
621e429 to
1df2072
Compare
vraghunandhan
approved these changes
Oct 25, 2026
vraghunandhan
approved these changes
Oct 25, 2026
vraghunandhan
approved these changes
Oct 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
Merchant views (
JuspayHeader,JuspayHeaderAttached,JuspayFooter,JuspayFooterAttached) did not render for apps on React Native below 0.82 running the New Architecture (bridgeless).createMerchantViewcalledgetReactNativeHost().getReactInstanceManager()before checkingIS_NEW_ARCHITECTURE_ENABLED. Bridgeless apps whoseReactNativeHostthrows there never reached theReactHostpath, and the stock host built an unused legacyReactInstanceManager. New Architecture builds now always take theReactHost.createSurface(activity, …)path that RN 0.82+ already uses.createReactSurfaceViewwas only reachable from the old branch and created surfaces with theReactApplicationContextinstead of the activity, so it is removed.RCTReactNativeFactorylookup checkedHyperSdkReactDelegate, then only ivars declared on the app delegate's own class.RCTAppDelegatesubclasses keep the factory in a superclass ivar, so they fell back toRCTRootView initWithBridge:, which never starts in bridgeless mode (RCTBridgeProxy.validisNO). The lookup now also asks the delegate forreactNativeFactory. The runtime-resolved selectors are declared in a small protocol, which also clears two existing-Wundeclared-selectorwarnings.newArchEnabledfor Android below 0.82 (the library reads only the unscoped property) and replaces the Swift-only AppDelegate note with merchant-view requirements for both platforms.Old-architecture apps and RN 0.82+ keep their current paths.
Test plan
:hyper-sdk-react:compileDebugJavaWithJavacpasses in the example app (RN 0.79.7) withnewArchEnabled=falseand with-PnewArchEnabled=truehyper-sdk-reactpod builds for the iOS simulator in the example app (RN 0.79.7, New Architecture), with no warnings left inHyperMerchantView.mmReactNativeHostthat throws fromgetReactInstanceManager(), iOS with anRCTAppDelegatesubclassNotes
yarn lintalready fails onmain(prettier errors inscripts/write-hyper-sdk-version.js), so these commits skipped only that pre-commit step.useNewApprochForMerchantViewis now implied bynewArchEnabled, becausebuild.gradleforces the New Architecture on 0.82+. A follow-up could drop it along with theREACT_NATIVE_VERSIONparsing. That would also remove the startupNumberFormatExceptionforreact-nativespecifiers such as>=0.83.1ornpm:aliases.