Contact
If your application is using the core implementation type, you can use these methods to manage your user's contacts.
Note: Please add #import <TapTalk/TapCoreContactManager.h> before using these methods.
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 Contact List

Create a new group Get all of the user's contact data from TapTalk.io.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] getAllUserContactsWithSuccess:^(NSArray<TAPUserModel *> * _Nonnull userArray) {
5
//Success get contact list data
6
} failure:^(NSError * _Nonnull error) {
7
//Failed to get contact list data
8
}];
Copied!

Get Contact Detail Info with TapTalk User ID

Get a detailed contact info with selected TapTalk.io user ID.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] getUserDataWithUserID:USER_ID success:^(TAPUserModel * _Nonnull user) {
5
//Success get contact detail data
6
} failure:^(NSError * _Nonnull error) {
7
//Failed to get contact detail data
8
}];
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).
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] getUserDataWithXCUserID:XC_USER_ID success:^(TAPUserModel * _Nonnull user) {
5
//Success get contact detail data
6
} failure:^(NSError * _Nonnull error) {
7
//Failed to get contact detail data
8
}];
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.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] addToTapTalkContactsWithUserID:USER_ID success:^{
5
//Success add to contact
6
} failure:^(NSError * _Nonnull error) {
7
//Failed add to contact
8
}];
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.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] getUserDataWithUserID:USER_ID success:^(TAPUserModel * _Nonnull user) {
5
//Success get contact detail data
6
} failure:^(NSError * _Nonnull error) {
7
//Failed to get contact detail data
8
}];
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.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] removeFromTapTalkContactsWithUserID:USER_ID success:^(NSString * _Nonnull successMessage) {
5
//Success remove from contact
6
} failure:^(NSError * _Nonnull error) {
7
//Failed remove from contact
8
}];
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.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] 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.
Objective-C
1
//import TapTalk Contact Manager
2
#import <TapTalk/TapCoreContactManager.h>
3
4
[[TAPCoreContactManager sharedManager] searchLocalContactsByName:KEYWORD success:^(NSArray<TAPUserModel *> * _Nonnull userArray) {
5
// Returns filtered contacts
6
} failure:^(NSError * _Nonnull error) {
7
// Failed to get contact list data
8
}];
Copied!
Parameters KEYWORD: (String) search keyword to filter full name