public class

User

extends Object
implements Parcelable
java.lang.Object
   ↳ com.nexmo.sdk.conversation.client.User

Class Overview

A user is a person associated with your Application. You populate the application users from your customer database using Application API. You use this SDK to add and remove users to a Conversation. A member is a User who has joined a Conversation. The following code example shows how to add a User to a Conversation:

 client.login(token, new RequestHandler {
         @Override
         public void onSuccess(User user) {
             Log.d(TAG, "onSuccess " + user.toString());
             self = user;
             // can update UI user info for ex.
         }

         @Override
         public void onError(NexmoAPIError error) {
         }
     });
 
The login method accepts any unique String as a User ID. You need to validate each user against your user DB before adding them to a Conversation.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<User> CREATOR
Public Constructors
User(String userId, String name)
User(User user)
Protected Constructors
User(Parcel in)
User()
Public Methods
static User createUser(String userId, String name, String displayName, String imageUrl)
int describeContents()
boolean equals(Object o)
static User fromJson(JSONObject userObject)
Construct User object from the network response
String getDisplayName()
String getImageUrl()
String getName()
String getUserId()
int hashCode()
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<User> CREATOR

Public Constructors

public User (String userId, String name)

public User (User user)

Protected Constructors

protected User (Parcel in)

protected User ()

Public Methods

public static User createUser (String userId, String name, String displayName, String imageUrl)

public int describeContents ()

public boolean equals (Object o)

public static User fromJson (JSONObject userObject)

Construct User object from the network response

Parameters
userObject network response
Throws
JSONException if required fields don't exist

public String getDisplayName ()

public String getImageUrl ()

public String getName ()

public String getUserId ()

public int hashCode ()

public String toString ()

public void writeToParcel (Parcel dest, int flags)