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 local storage | |
Fetch the user's latest contact data from TapTalk.io server | |
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 | |
Submit a report for a selected user. | |
Submit a report for a selected message. | |
Block a user from sending or receiving messages. | |
Unblock a blocked user. | |
Retrieve a list of blocked users. | |
Retrieve a list of IDs from blocked users. | |
Retrieve the list of groups in common with another user. |
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?) {
}
})
Calling
fetchAllUserContactsFromServer
will fetch the user's latest contact data from TapTalk.io server and syncs it to the device's local storage.Java
Kotlin
TapCoreContactManager.getInstance().fetchAllUserContactsFromServer(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().fetchAllUserContactsFromServer(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 userGet 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 userAdd 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 addedAdd 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 addedRemove 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 removeSave 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 savedCall 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 nameYou may call this method to submit a report for a selected user. Submitted reports can then be viewed through the dashboard.
Java
Kotlin
TapCoreContactManager.getInstance().reportUser(USER_ID, CATEGORY, IS_OTHER_CATEGORY, REASON, new TapCommonListener() {
@Override
public void onSuccess(String successMessage) {
// Successfully reported user
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().reportUser(USER_ID, IS_OTHER_CATEGORY, REASON, object : TapCommonListener() {
override fun onSuccess(successMessage: String?) {
// Successfully reported user
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters
USER_ID
: (String) ID of the user to report
CATEGORY
: (String) Category of the violation. max length is 100 characters
IS_OTHER_CATEGORY
: (Boolean) If the category is other than the predefined categories
REASON
: (String) reason why the user is reportedYou may call this method to submit a report for a selected message. Submitted reports can then be viewed through the dashboard.
Java
Kotlin
TapCoreContactManager.getInstance().reportMessage(MESSAGE_ID, ROOM_ID, CATEGORY, IS_OTHER_CATEGORY, REASON, new TapCommonListener() {
@Override
public void onSuccess(String successMessage) {
// Successfully reported message
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().reportMessage(MESSAGE_ID, ROOM_ID, IS_OTHER_CATEGORY, REASON, object : TapCommonListener() {
override fun onSuccess(successMessage: String?) {
// Successfully reported message
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters
MESSAGE_ID
: (String) unique server ID of the message to report
ROOM_ID
: (String) ID of the room where the message belongs to
CATEGORY
: (String) Category of the violation. max length is 100 characters
IS_OTHER_CATEGORY
: (Boolean) If the category is other than the predefined categories
REASON
: (String) reason why the message is reportedYou may block a user to stop conversation flow with the blocked user. Blocked users will not be able to send and receive message, or retrieve profile info from the active user.
Java
Kotlin
TapCoreContactManager.getInstance().blockUser(USER_ID, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Successfully blocked user
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().blockUser(USER_ID, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Successfully blocked user
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters
USER_ID
: (String) ID of the user to blockYou may unblock a blocked user to let them send and receive message from the active user.
Java
Kotlin
TapCoreContactManager.getInstance().unblockUser(USER_ID, new TapCoreGetContactListener() {
@Override
public void onSuccess(TAPUserModel user) {
// Successfully unblocked user
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().unblockUser(USER_ID, object : TapCoreGetContactListener() {
override fun onSuccess(user: TAPUserModel?) {
// Successfully unblocked user
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters
USER_ID
: (String) ID of the user to unblockYou may call this method to retrieve a list of blocked users.
Java
Kotlin
TapCoreContactManager.getInstance().getBlockedUserList(new TapCoreGetMultipleContactListener() {
@Override
public void onSuccess(List<TAPUserModel> blockedUsers) {
// Successfully retrieved blocked users
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getBlockedUserList(object : TapCoreGetMultipleContactListener() {
override fun onSuccess(blockedUsers: List<TAPUserModel>) {
// Successfully retrieved blocked users
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
You may call this method to retrieve a list of IDs from blocked users.
Java
Kotlin
TapCoreContactManager.getInstance().getBlockedUserIDs(new TapCoreGetStringArrayListener() {
@Override
public void onSuccess(ArrayList<String> blockedUserIDs) {
// Successfully retrieved blocked user IDs
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getBlockedUserIDs(object : TapCoreGetStringArrayListener() {
override fun onSuccess(blockedUserIDs: ArrayList<String>) {
// Successfully retrieved blocked user IDs
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
You may use
getGroupsInCommon
method to retrieve the list of groups in common with another user.Java
Kotlin
TapCoreContactManager.getInstance().getGroupsInCommon(USER_ID, new TapCoreGetRoomArrayListener() {
@Override
public void onSuccess(ArrayList<TAPRoomModel> rooms) {
// Successfully retrieved rooms
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
TapCoreContactManager.getInstance().getGroupsInCommon(USER_ID, object : TapCoreGetRoomArrayListener() {
override fun onSuccess(rooms: ArrayList<TAPRoomModel>) {
// Successfully retrieved rooms
}
override fun onError(errorCode: String?, errorMessage: String?) {
}
})
Parameters
USER_ID
: (String) ID of the other userLast modified 8mo ago