Add iOS BridgeViewProvider for React Native view overrides#31
Open
asikora-sf wants to merge 5 commits intosalesforce:devfrom
Open
Add iOS BridgeViewProvider for React Native view overrides#31asikora-sf wants to merge 5 commits intosalesforce:devfrom
asikora-sf wants to merge 5 commits intosalesforce:devfrom
Conversation
This was referenced Mar 5, 2026
Replace componentTypes[] + reactComponentName with a componentMap Record<string, string> so each SDK component type maps to its own React Native component name.
Bridges the native SDK view customization to React Native via RCTRootView. - BridgeViewProvider: canHandle() checks pre-registered types, view() renders RCTRootView in SwiftUI - registerViewProvider/clearViewProvider native methods exposed to JS - ViewProvider passed to AgentforceClient init when registered
Replace Set<String> + single reactComponentName with a [String: String] dictionary mapping each component definition to its own React component. canHandle() checks map keys, view() looks up the component name per type.
61db233 to
0045b72
Compare
RCTRootView embedded in UIViewRepresentable was getting zero size because SwiftUI had no sizing information. Set sizeFlexibility and implement sizeThatFits so the React content measures correctly.
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
BridgeViewProvider.swiftimplementingAgentforceViewProvidingprotocolcanHandle(type:)checks against pre-registered component type strings from JSview(for:data:)returns anRCTRootViewwrapped in SwiftUI viaUIViewRepresentableregisterViewProvider/clearViewProvidernative methods toAgentforceModuleAgentforceClientinit when registeredStack
PR 2/6 in the
viewproviderstack. Depends on PR #30.Test plan