Validate and troubleshoot mobile SDK integration
This guide covers steps to validate and test your mobile SDK integration. It also talks about some common issues when integrating the Exponea mobile SDKs with Data hub event streams.
Validate implementation
NoteUse the Bloomreach Tracking Console Chrome extension to test and verify your integration, or debug tracking issues.
After configuring Data hub integration:
-
Build and run your mobile app.
-
Trigger tracking events (screen views, button taps).
-
Verify events appear in your Engagement project:
-
Navigate to Data & Assets > Customers.
-
Search for test customer profiles.
-
Check Data & Assets > Data manager to verify events are being recorded.
-
If using JWT authentication:
-
Test with valid tokens to verify events are accepted.
-
Test without tokens to verify signed-only events are rejected.
-
Monitor authentication failures in
SdkAuthCallback. -
Monitor authentication failures in your JWT error handler.
-
Verify the proactive refresh fires ~60 seconds before token expiry.
Troubleshooting
Events not appearing in Engagement
Cause: Stream ID is incorrect, or the event stream is not connected to the Engagement project.
Solution:
-
Verify your stream ID matches the ID in Data hub (Events > your stream > Access security).
-
Check event stream destinations (Events > your stream > Destinations) to ensure your Engagement project is connected.
JWT authentication failures
Cause: Token is invalid, expired, or doesn't include required customer IDs.
Solution:
-
Verify your backend is using the correct signing key from Data hub.
-
Check that the JWT includes the customer IDs you're sending in tracking requests.
-
Ensure the
kidheader matches your signing key ID. -
Validate that the token's expiration (
expclaim) is set appropriately and not in the past.
Unsupported configuration options
Cause: Using project/Engagement configuration parameters with stream configuration.
Solution: Remove these parameters when using StreamConfig (Android) or StreamSettings (iOS):
Android (StreamConfig) | iOS (StreamSettings) |
|---|---|
advancedAuthEnabled | authorization |
AuthorizationProvider | projectToken |
integrationRouteMap | projectMapping |
advancedAuthEnabled |
Token cleared unexpectedly
Cause: Calling identifyCustomer without including the JWT token parameter.
Solution: When updating customer IDs, always pass the current token explicitly if you want to keep the existing token.
Exponea.identifyCustomer(
customerIdentity = CustomerIdentity(
customerIds = mapOf("registered" to "[email protected]"),
sdkAuthToken = currentToken
)
)let identity = CustomerIdentity(
customerIds: ["registered": "[email protected]"],
jwtToken: Exponea.shared.getCurrentJwtToken()
)
Exponea.shared.identifyCustomer(context: identity, properties: [:], timestamp: nil)iOS-specific issues
JWT error handler not firing
Cause: The error handler was registered after setting the token.
Solution: Always call setJwtErrorHandler before setSdkAuthToken to ensure the proactive refresh timer can notify the handler when the token approaches expiry.
App Inbox requests fail with 401
Cause: No JWT token is set when calling App Inbox methods in stream mode.
Solution: Ensure setSdkAuthToken is called before using App Inbox:
Exponea.shared.setSdkAuthToken("YOUR_JWT_TOKEN")
Exponea.shared.fetchAppInboxMessages { result in
// handle result
}Updated about 4 hours ago