setUserId static method

Future<void> setUserId({
  1. required String userId,
})

Sets the user ID for the SDK. This is optional but recommended for tracking user-specific data. The user ID can be used to identify the user across sessions. It should be unique for each user.

Implementation

static Future<void> setUserId({required String userId}) async {
  try {
    await _channel.invokeMethod('setUserId', {'userId': userId});
  } catch (e) {
    debugPrint('Error setting user ID: $e');
  }
}