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 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 a user with selected TapTalk.io user ID from the active user's contacts
Save or update existing user data to local cache
Search the active user's contacts from the device's local storage with a keyword

Get all of the user's contact data from TapTalk.io.
Java
Kotlin
TapCoreContactManager.getInstance().getAllUserContacts(new TapCoreGetMultipleContactListener() {
@Override
public void onSuccess(List<TAPUserModel> users) {
// Returns a list of the active user's TapTalk.io contacts
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getAllUserContacts(object : TapCoreGetMultipleContactListener() {
override fun onSuccess(users: List<TAPUserModel>?) {
// Returns a list of the active user's TapTalk.io contacts
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})

Get a detailed contact info with selected TapTalk.io user ID.
Java
Kotlin
TapCoreContactManager.getInstance().getUserDataWithUserID(USER_ID, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Returns detailed user info
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getUserDataWithUserID(USER_ID, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Returns detailed user info
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters USER_ID: (String) Taptalk.io User ID of the selected user

Get a detailed contact info with selected Client user ID (xcUserID).
Java
Kotlin
TapCoreContactManager.getInstance().getUserDataWithXCUserID(XC_USER_ID, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Returns detailed user info
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getUserDataWithXCUserID(XC_USER_ID, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Returns detailed user info
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters XC_USER_ID: (String) Client User ID of the selected user

Add a user with selected TapTalk.io user ID to the active user's contacts.
Java
Kotlin
TapCoreContactManager.getInstance().addToTapTalkContactsWithUserID(USER_ID, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Added to contacts successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().addToTapTalkContactsWithUserID(USER_ID, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Added to contacts successfully
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters USER_ID: (String) Taptalk.io User ID of the contact to be added

Add a user with selected phone number to the active user's contacts.
Java
Kotlin
TapCoreContactManager.getInstance().addToTapTalkContactsWithPhoneNumber(PHONE_NUMBER, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Added to contacts successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().addToTapTalkContactsWithPhoneNumber(PHONE_NUMBER, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Added to contacts successfully
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters PHONE_NUMBER: (String) phone number of the contact to be added

Remove a user with selected TapTalk.io user ID from the active user's contacts.
Java
Kotlin
TapCoreContactManager.getInstance().removeFromTapTalkContacts(USER_ID, new TapCommonListener() {
@Override
public void onSuccess(String successMessage) {
// Removed from contacts successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().removeFromTapTalkContacts(USER_ID, object : TapCommonListener() {
override fun onSuccess(successMessage: String?) {
// Removed from contacts successfully
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters USER_ID: (String) Taptalk.io User ID of the contact to remove

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

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
TapCoreContactManager.getInstance().searchLocalContactByName(KEYWORD, new TapCoreGetMultipleContactListener() {
@Override
public void onSuccess(List<TAPUserModel> users) {
// Returns filtered contacts
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().searchLocalContactByName(KEYWORD, object : TapCoreGetMultipleContactListener() {
override fun onSuccess(users: List<TAPUserModel>?) {
// Returns filtered contacts
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters KEYWORD: (String) search keyword to filter full name
Copy link
On this page
Get All User Contact
Get Contact Detail Info with TapTalk User ID
Get Contact Detail Info with Client User ID
Add User to Contact with User ID
Add User to Contact with Phone Number
Remove User from Contact
Save User Data
Search Local Contact