setUserId method

  1. @override
Future<void> setUserId({
  1. String? id,
  2. AnalyticsCallOptions? callOptions,
})
override

Sets the user id. Setting a null id removes the user id. callOptions are for web platform only.

Implementation

@override
Future<void> setUserId({
  String? id,
  AnalyticsCallOptions? callOptions,
}) {
  try {
    return channel.invokeMethod<void>(
      'Analytics#setUserId',
      <String, String?>{'userId': id},
    );
  } catch (e, s) {
    convertPlatformException(e, s);
  }
}