setUserId method
If your app has its own login system that you want to track users with, you can set the userId.
Implementation
Future<void> setUserId(String? userId, {bool? startNewSession}) async {
Map<String, dynamic> properties = _baseProperties();
properties['userId'] = userId;
if (startNewSession != null) {
properties['startNewSession'] = startNewSession;
}
return await _channel.invokeMethod('setUserId', jsonEncode(properties));
}