Hi there!
When using Mobile SDK-based integrations like Apple Health, Samsung Health, or Health Connect, the widget will redirect users to your auth_success_redirect_url with a null user_id by default. This is expected behavior for Samsung Health: a Terra user isn’t created immediately in the dashboard since the connection must be completed via the Terra Mobile SDK!
Here's how to handle Samsung Health properly:
Set up deep links
Redirect your users back into your app (e.g., yourapp://on_auth_success) after the widget flow. The widget will pass user_id, reference_id, and resource as query params.
Install & initialize the SDK
Complete the connection
- After redirect, call initConnection() with Connection.samsung to finalise Samsung Health linking.
Generate an auth token
- Use the Generate Auth Token endpoint from your backend before calling initConnection().