| 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
| int |
CONTENTS_FILE_DESCRIPTOR |
|
| int |
PARCELABLE_WRITE_RETURN_VALUE |
|
|
| Public Constructors |
|
|
User(String userId, String name)
|
|
|
User(User user)
|
| Protected Constructors |
|
|
User(Parcel in)
|
|
|
User()
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
final
void
|
wait()
|
|
From interface
android.os.Parcelable
|
abstract
int
|
describeContents()
|
|
abstract
void
|
writeToParcel(Parcel arg0, int arg1)
|
|
Fields
public
static
final
Creator<User>
CREATOR
Public Constructors
public
User
(String userId, String name)
Protected Constructors
protected
User
(Parcel in)
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
getUserId
()
public
String
toString
()
public
void
writeToParcel
(Parcel dest, int flags)