Create / Login
TalkPlus supports anonymous and token-based login. In order to use token-based login, you must call /api/users/create and /api/users/login from our REST API endpoints to create user and obtain user login token.
If you need translation feature, see below.
1. Anonymous User
You need a unique user ID and a username to login anonymously.

// manually set profile image URL
TPLoginParams *params =
[[TPLoginParams alloc] initWithLoginType:TPLoginAnonymous userId:userId];
params.userName = userName;
params.profileImageUrl = profileImageUrl;
params.metaData = metaData;
params.translationLanguage = translationLanguage;
[[TalkPlus sharedInstance] login:params success:^(TPUser *tpUser) {
success:^(TPUser *tpUser) {
// SUCCESS
} failure:^(int errorCode, NSError *error) {
// FAILURE
}];
// upload profile image file
TPLoginParams *params =
[[TPLoginParams alloc] initWithLoginType:TPLoginAnonymous userId:userId];
params.userName = userName;
params.profileImage = profileImage;
params.metaData = metaData;
params.translationLanguage = translationLanguage;
[[TalkPlus sharedInstance] login:params success:^(TPUser *tpUser) {
success:^(TPUser *tpUser) {
// SUCCESS
} failure:^(int errorCode, NSError *error) {
// FAILURE
}];2. Token User
You need a unique user ID, a username and a login token to log in.
Last updated