Solution: Only call launchConversation() when the app is in the foreground with an active Activity. Call it from a button press handler, not from a background task.
Blank or Loading Screen
If the conversation opens but shows a loading spinner indefinitely:
Possible causes and solutions:
Network connectivity: Verify the device has internet access and can reach Salesforce servers.
Agent not active: Verify the agent is active and deployed in your Salesforce org. Check Setup > Agentforce to confirm the agent status.
Missing AndroidManifest entry (Android only): Verify AgentforceConversationActivity is declared:
Wrong serviceApiURL: A 400 error during session start often indicates an incorrect URL. Double-check that you’re using the Service API URL, not your org’s login URL.
Employee Agent Token Issues
These errors relate to OAuth authentication for Employee Agent mode.
Token Expired
Symptom: Conversation fails to load or shows an auth error after working previously.
These issues affect the logger delegate functionality.
No Logs Received
Possible causes:
Delegate set after configure(): Register the logger before configure() to catch initialization logs.
Native module not found: Check for the warning about native module not available.
Platform-specific: On Android, the debug log level isn’t emitted.
Feature Flag Changes Not Taking Effect
Cause: Feature flags are read at configure() time.
Solution: After changing flags via setFeatureFlags(), call configure() again:
1await AgentforceService.setFeatureFlags({2 enableMultiModalInput: true,3});45// Must reconfigure for changes to take effect6await AgentforceService.configure({7 /* same config as before */8});
Platform-Specific Build Errors
These errors occur during the build process on iOS or Android.
iOS: Module 'AgentforceSDK' Not Found
1No such module 'AgentforceSDK'
Solution:
Run pod install in the ios directory.
Ensure you’re using use_frameworks! :linkage => :static.
Verify the AgentforceSDK pod is resolved in Podfile.lock.
Symptom: Build errors related to Jetpack Compose version conflicts.
Cause: Your app uses a different Compose BOM version than the bridge.
Solution: Align the Compose BOM version. The bridge uses compose-bom:2024.02.00. If your app uses a different BOM, you may need to exclude the bridge’s BOM and rely on your app’s, or align versions.
Android: Kotlin Version Mismatch
Symptom: Build errors related to Kotlin version incompatibility.
Cause: The bridge uses Kotlin 2.2.0. Your app may use a different version.
Solution: Align the Kotlin version in your project-level build.gradle:
1buildscript {2 ext.kotlin_version = '2.2.0'3}
iOS: Bridging Header Issues
Symptom: Swift bridging errors when your app is Objective-C only.
Cause: The bridge is written in Swift, and your Objective-C project needs a bridging header.
Solution:
Create an empty Swift file in your Xcode project.
When Xcode prompts to create a bridging header, accept.
Build again.
Logs Stop After a While
Symptom: Logger delegate stops receiving log messages after working initially.
Cause: The logger delegate was cleared, either by calling clearLoggerDelegate(), destroy(), or by a React component unmounting that set up the delegate.
Solution: Ensure your delegate setup persists for the lifetime you need it:
1// Set up at app level, not in a component that might unmount2AgentforceService.setLoggerDelegate({ onLog: handleLog });
If using a component, ensure the cleanup only happens when appropriate:
1React.useEffect(() => {2 AgentforceService.setLoggerDelegate({ onLog: handleLog });3 return () => {4 // Only clear if this component should own the delegate5 AgentforceService.clearLoggerDelegate();6 };7}, []);
Additional Context Errors
These errors occur when setting additional context variables.
NO_CONVERSATION
1Error: No active conversation. Launch conversation first, then set context.