[ReactNative][Android] react-native-force calls removed ClientManager.peekUnauthenticatedRestClient() - #489
Conversation
…ient() SalesforceMobileSDK-Android's ClientManager rewrite for multi-user support (716ee6625) removed peekUnauthenticatedRestClient(), breaking Kotlin compilation of react-native-force. Use SalesforceSDKManager.getInstance().getUnauthenticatedRestClient(), the SDK's replacement API, matching the same pattern already used by the analogous Cordova/Hybrid bridge.
…tClient and logout() param shape SalesforceMobileSDK-Android's ClientManager rewrite for multi-user support (716ee6625) also removed ClientManager.RestClientCallback and the async ClientManager.getRestClient(activity, callback) overload, and changed SalesforceSDKManager.logout() to take (account, frontActivity, showLoginPage, reason) with no @jvmoverloads, so Java callers must supply all four positional args. Update SalesforceReactActivity's login()/authenticate() to use SalesforceSDKManager.getInstance().getRestClient(activity, callback) with SalesforceSDKManager.RestClientCallback (mirroring SalesforceActivityDelegate, the SDK's own shared Java call site for this pattern), and logout() to pass the full positional argument list (mirroring UserAccountManager's Java call site).
|
CI shows 3 failing checks ( Android: The actual fix compiles cleanly — iOS (^18, ^26): This PR touches no iOS files. The build fails with Both failure signatures reproduce identically on This response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce. |
47abf6a
into
forcedotcom:dev
Summary
SalesforceMobileSDK-Android'sClientManagerrewrite for multi-user support (716ee6625) removed APIs thatreact-native-force's Android bridge depended on, breaking the build for all four React Native Android templates.SalesforceNetReactBridge.kt: replaced removedClientManager.peekUnauthenticatedRestClient()withSalesforceSDKManager.getInstance().getUnauthenticatedRestClient()(same pattern as the Cordova/Hybrid bridge).SalesforceReactActivity.java: replaced the removedClientManager.RestClientCallback/ asyncgetRestClient(activity, callback)with theSalesforceSDKManagerequivalents, and updatedlogout()to pass all four positional args (the new signature has no@JvmOverloads).Test plan
androidTests/subproject:compileDebugKotlin,compileDebugJavaWithJavac, and:app:assembleDebugallBUILD SUCCESSFUL.yarn install+ Android build).This response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.