Register a user

  • Usually we are registering client's information in LoginActivitiy when the client passes some data in forms.

    This will create a user in User.com with all the attributes you specify, or log in an existing one if data matches the record in User.com database.

    Set standard and custom attributes

    You can add any number of custom customer attributes, or use predefined standard attributes

    UserSDK.default?.setUserData([
       UserSDK.UserDataKey.firstName : "Test",
       UserSDK.UserDataKey.lastName : "User",
       UserSDK.UserDataKey.email : "test@user.com",
       UserSDK.UserDataKey.phone : "+1222333444",
       UserSDK.UserDataKey.userId : "yourcustomerid"
    ])
    
    UserSDK.default?.setCustomUserData([
       "custom attribute name" : "custom attribute value"
    ])
  • Logout

    To logout and clear all user-related resources within SDK, invoke:

    UserSDK.default?.logout()