Contact
If your application is using the core implementation type, you can use the TapCoreContactManager class to manage your user's contacts.
TapTalk Contact Method
Description
​Get All User Contact​
Get all of the user's contact data from TapTalk.io
Get a detailed contact info with selected TapTalk.io user ID
Get a detailed contact info with selected Client user ID (xcUserID)
Add a user with selected TapTalk.io user ID to the active user's contacts
Add a user with selected phone number to the active user's contacts
​Remove User from Contact​
Remove a user with selected TapTalk.io user ID from the active user's contacts
​Save User Data​
Save or update existing user data to local cache
​Search Local Contact​
Search the active user's contacts from the device's local storage with a keyword

Get All User Contact

Get all of the user's contact data from TapTalk.io.
Java
Kotlin
1
TapCoreContactManager.getInstance().getAllUserContacts(new TapCoreGetMultipleContactListener() {
2
@Override
3
public void onSuccess(List<TAPUserModel> users) {
4
// Returns a list of the active user's TapTalk.io contacts
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().getAllUserContacts(object : TapCoreGetMultipleContactListener() {
2
override fun onSuccess(users: List<TAPUserModel>?) {
3
// Returns a list of the active user's TapTalk.io contacts
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!

Get Contact Detail Info with TapTalk User ID

Get a detailed contact info with selected TapTalk.io user ID.
Java
Kotlin
1
TapCoreContactManager.getInstance().getUserDataWithUserID(USER_ID, new TapCoreGetContactListener() {
2
@Override
3
public void onSuccess(TAPUserModel user) {
4
// Returns detailed user info
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().getUserDataWithUserID(USER_ID, object : TapCoreGetContactListener() {
2
override fun onSuccess(user: TAPUserModel?) {
3
// Returns detailed user info
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters USER_ID: (String) Taptalk.io User ID of the selected user

Get Contact Detail Info with Client User ID

Get a detailed contact info with selected Client user ID (xcUserID).
Java
Kotlin
1
TapCoreContactManager.getInstance().getUserDataWithXCUserID(XC_USER_ID, new TapCoreGetContactListener() {
2
@Override
3
public void onSuccess(TAPUserModel user) {
4
// Returns detailed user info
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().getUserDataWithXCUserID(XC_USER_ID, object : TapCoreGetContactListener() {
2
override fun onSuccess(user: TAPUserModel?) {
3
// Returns detailed user info
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters XC_USER_ID: (String) Client User ID of the selected user

Add User to Contact with User ID

Add a user with selected TapTalk.io user ID to the active user's contacts.
Java
Kotlin
1
TapCoreContactManager.getInstance().addToTapTalkContactsWithUserID(USER_ID, new TapCoreGetContactListener() {
2
@Override
3
public void onSuccess(TAPUserModel user) {
4
// Added to contacts successfully
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().addToTapTalkContactsWithUserID(USER_ID, object : TapCoreGetContactListener() {
2
override fun onSuccess(user: TAPUserModel?) {
3
// Added to contacts successfully
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters USER_ID: (String) Taptalk.io User ID of the contact to be added

Add User to Contact with Phone Number

Add a user with selected phone number to the active user's contacts.
Java
Kotlin
1
TapCoreContactManager.getInstance().addToTapTalkContactsWithPhoneNumber(PHONE_NUMBER, new TapCoreGetContactListener() {
2
@Override
3
public void onSuccess(TAPUserModel user) {
4
// Added to contacts successfully
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().addToTapTalkContactsWithPhoneNumber(PHONE_NUMBER, object : TapCoreGetContactListener() {
2
override fun onSuccess(user: TAPUserModel?) {
3
// Added to contacts successfully
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters PHONE_NUMBER: (String) phone number of the contact to be added

Remove User from Contact

Remove a user with selected TapTalk.io user ID from the active user's contacts.
Java
Kotlin
1
TapCoreContactManager.getInstance().removeFromTapTalkContacts(USER_ID, new TapCommonListener() {
2
@Override
3
public void onSuccess(String successMessage) {
4
// Removed from contacts successfully
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().removeFromTapTalkContacts(USER_ID, object : TapCommonListener() {
2
override fun onSuccess(successMessage: String?) {
3
// Removed from contacts successfully
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters USER_ID: (String) Taptalk.io User ID of the contact to remove

Save User Data

Save or update existing user data to local cache.
Java
Kotlin
1
TapCoreContactManager.getInstance().saveUserData(USER);
Copied!
1
TapCoreContactManager.getInstance().saveUserData(USER)
Copied!
Parameters USER: (TAPUserModel) the user data model to be saved

Search Local Contact

Call this method to search the active user's contacts from the device's local storage with a keyword. Provided keyword will be used to filter the contacts' full name in the search result.
Java
Kotlin
1
TapCoreContactManager.getInstance().searchLocalContactByName(KEYWORD, new TapCoreGetMultipleContactListener() {
2
@Override
3
public void onSuccess(List<TAPUserModel> users) {
4
// Returns filtered contacts
5
}
6
​
7
@Override
8
public void onError(String errorCode, String errorMessage) {
9
​
10
}
11
});
Copied!
1
TapCoreContactManager.getInstance().searchLocalContactByName(KEYWORD, object : TapCoreGetMultipleContactListener() {
2
override fun onSuccess(users: List<TAPUserModel>?) {
3
// Returns filtered contacts
4
}
5
​
6
override fun onError(errorCode: String?, errorMessage: String?) {
7
​
8
}
9
})
Copied!
Parameters KEYWORD: (String) search keyword to filter full name