A User profile contains information about the user like email, phone number, name, etc. Contlo creates a user profile for each user that launches your application, regardless of the login status.

There are two types of users:

  • Anonymous Users: Unidentified users whose profile does not have an email or a phone number. When a new user launches your application, Contlo creates an anonymous profile for them. The profile includes a Mobile Push Subscription that is in a pending state.
  • Identified users: These are users with known email or phone number information.

Set up profile details

To set up the user profile, use the sendUserDetails() method in the Contlo SDK. You only need to call this method once. Add this method to the file that contains the login flow of the application.

// Example
// import the Contlo package

import 'package:contlo_plugin/contlo_plugin.dart';

// Define the sendUserDetails() method

Future<void> sendUserDetails() async {
    try {
      print("Send user: $email, $phone, $name, $city");
      String data = await ContloPlugin.sendUserDetail({
        "email": email,
        "phone_number":phone,
        "first_name": name,
        "city": city,
      });
      print("User details response: $data");
    } on PlatformException catch (e){
      print("Exception thrown $e");
    }
}


📘

You can add users or migrate existing user profiles to Contlo from the dashboard. Go to the Audience section and click on the Add Contacts button.

Profile Properties

These are the custom properties of a user that accept key-value pairs. Profile properties contain some extra information about the user. You can define these properties under custom_propeties in the sendUserDetails() method as shown below:

ContloPlugin.sendUserDetail({
        "email": email,
        "phone_number":phone,
        "first_name": name,
        "city": city,
        "custom_properties": {
          'key_1': 'value_1',
          'key_2': 'value_2'
        }
      });
      

After you define the user details, you can see all the user's information in the Audience section on the Contlo Dashboard.