setUser method

  1. @override
Future setUser(
  1. String? userId, {
  2. Map<String, dynamic>? info,
})
override

Track current logged-in user.

userId is app user identifier. Set userId = null to clear. An optional info Map with primitive types values can be provided.

Implementation

@override
Future setUser(String? userId, {Map<String, dynamic>? info}) async {
  try {
    return await _channel.invokeMethod("setUser", {
      "userId": userId,
      if (info != null) "info": info,
    });
  } on PlatformException catch (e) {
    debugPrint("DIAnalytics setUser error $e");
  }
}