setUserId static method
Switches the active user for the underlying native SDK instance.
Android behavior:
- Stops the current recording/session (if running)
- Switches SDK identity to the provided
userId - Refreshes configuration from the server for the new user
Notes:
- This
Futurecompletes when the native Android SDK finishes the refresh via its init callback (success/failure). - You should call
startRecording()again after this returnstrue. - Returns
falseif the request is rejected locally (e.g., blankuserId, SDK not initialized) or if the refresh fails.
Implementation
static Future<bool> setUserId(String userId) async {
final args = <String, Object>{Constants.paramUserId: userId};
final bool? result =
await _channel.invokeMethod<bool>(Constants.caseSetUserId, args);
return result ?? false;
}