onUserLogin method Null safety

Future<void> onUserLogin(
  1. Map<String, dynamic> profile

Creates a separate and distinct user profile identified by one or more of Identity, Email, FBID or GPID values, and populated with the key-values included in the profile map argument.

If your app is used by multiple users, you can use this method to assign them each a unique profile to track them separately.

If instead you wish to assign multiple Identity, Email, FBID and/or GPID values to the same user profile, use profileSet rather than this method.

If none of Identity, Email, FBID or GPID is included in the profile map, all profile map values will be associated with the current user profile.

When initially installed on this device, your app is assigned an "anonymous" profile. The first time you identify a user on this device (whether via onUserLogin or profileSet), the "anonymous" history on the device will be associated with the newly identified user.

Then, use this method to switch between subsequent separate identified users.

Please note that switching from one identified user to another is a costly operation in that the current session for the previous user is automatically closed and data relating to the old user removed, and a new session is started for the new user and data for that user refreshed via a network call to CleverTap. In addition, any global frequency caps are reset as part of the switch.

@param profile The map keyed by the type of identity, with the value as the identity


static Future<void> onUserLogin(Map<String, dynamic> profile) async {
  return await _channel.invokeMethod('onUserLogin', {'profile': profile});