GiantHeron1 week ago
When i choose Samsung on the widget, it shows the success message - "Your device is connected successfully to samsung.", But the user doesn't get created on the terra dashboard?
Vanessaadmin1 week ago
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
// Example token received from your backend String token = 'example_token'; // Define connection type and custom permissions Connection connection = Connection.samsung; // For Samsung Health List<CustomPermission> customPermissions = []; // Leave empty to default to all permissions bool schedulerOn = true; // Enables background delivery // Initialize the connection SuccessMessage? result = await TerraFlutter.initConnection( connection, // The type of connection (e.g., Samsung Health) token, // Token received from backend schedulerOn, // Enables background delivery customPermissions // Empty list for custom permissions ); if (result?.error != null) { throw Exception('Failed to initialise connection ${result?.error}'); } // Connection successful! }
Generate an auth token
Vanessaadmin1 week ago
Important notes
Terra API provides you with direct Samsung Health SDK access through a privileged partnership! Meaning if you apply for Samsung Health, please submit a ticket via the Terra Dashboard on Support. This makes sure we know that you've submitted the application and we can ensure that you get accepted. Once approved, you’ll receive the dedicated setup.
Hope this helps :)
Cookie Preferences