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

📘

Note

Use the Bloomreach Tracking Console Chrome extension to test and verify your integration, or debug tracking issues.

After configuring Data hub integration:

  1. Build and run your mobile app.

  2. Trigger tracking events (screen views, button taps).

  3. 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:

  1. Test with valid tokens to verify events are accepted.

  2. Test without tokens to verify signed-only events are rejected.

  3. Monitor authentication failures in SdkAuthCallback.

  4. Monitor authentication failures in your JWT error handler.

  5. 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:

  1. Verify your stream ID matches the ID in Data hub (Events > your stream > Access security).

  2. 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:

  1. Verify your backend is using the correct signing key from Data hub.

  2. Check that the JWT includes the customer IDs you're sending in tracking requests.

  3. Ensure the kid header matches your signing key ID.

  4. Validate that the token's expiration (exp claim) 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)
advancedAuthEnabledauthorization
AuthorizationProviderprojectToken
integrationRouteMapprojectMapping
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
}

© Bloomreach, Inc. All rights reserved.