TTKit Class Reference
Inherits from | NSObject |
---|---|
Declared in | TTKitClass.h |
Overview
TTKit is the main object used when using the TTKit iOS SDK. It contains methods that include SDK initialization and user, message and other model object controls. In addition to creating and manipulating objects, TTKit provides encrypted in-memory and disk based caches to improve performance.
Warning: When initializing TTKit, please wait until the isReady property is set to YES or the TTKitReadyNotification is posted before using the provided services.
Other Methods
isReady
The isReady property will be TRUE when TTKit is properly initialized and ready to be used.
@property (nonatomic, readonly) BOOL isReady
Declared In
TTKitClass.h
isConnected
The isConnected property will be TRUE once TTKit establishes a stream with the server.
@property (nonatomic, readonly) BOOL isConnected
Declared In
TTKitClass.h
ttKey
The ttKey property contains the key used when initializing TTKit.
@property (nullable, nonatomic, readonly) NSString *ttKey
Declared In
TTKitClass.h
ttSecret
The ttSecret property contains the secret used when initializing TTKit.
@property (nullable, nonatomic, readonly) NSString *ttSecret
Declared In
TTKitClass.h
userToken
The userToken property contains the logged in user’s token.
@property (nullable, nonatomic, readonly) NSString *userToken
Declared In
TTKitClass.h
agentName
The agentName property contains the agentName used when initializing TTKit.
@property (nullable, nonatomic, readonly) NSString *agentName
Declared In
TTKitClass.h
Application Lifecycle
– initializeWithConfiguration:
Initializing TTKit. This method should be called in the App Delegate.
- (void)initializeWithConfiguration:(TTKitConfiguration *_Nonnull)configuration
Parameters
configuration |
TTKitConfiguration object |
---|
Declared In
TTKitClass.h
+ sharedInstance
Return the TTKit shared instance.
+ (instancetype _Nonnull)sharedInstance
Return Value
TTKit shared instance.
Declared In
TTKitClass.h
– signupWithUserId:password:success:failure:
Signup to TigerText.
- (void)signupWithUserId:(NSString *_Nonnull)userId password:(NSString *_Nonnull)password success:(void ( ^ _Nullable ) ( TTUser *_Nonnull newUser , NSString *_Nullable validationPhoneNumber , NSString *_Nullable validationText , BOOL inboundSmsVerification , BOOL disableSmsValidation , BOOL extAuth ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
userId |
user login id (Email or username). |
---|---|
password |
user’s password. |
success |
success return block. |
failure |
failure return block. |
Declared In
TTKitClass.h
– loginWithUserId:password:success:failure:
Login to TTKit.
- (void)loginWithUserId:(NSString *_Nonnull)userId password:(NSString *_Nonnull)password success:(void ( ^ _Nullable ) ( TTUser *_Nonnull newUser ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
userId |
user login id (Email or username). |
---|---|
password |
user’s password. |
success |
success return block. |
failure |
failure return block. |
Declared In
TTKitClass.h
– loginWithKey:secret:agent:success:failure:
Login to TTKit.
- (void)loginWithKey:(NSString *_Nonnull)key secret:(NSString *_Nonnull)secret agent:(NSString *_Nullable)agent success:(void ( ^ _Nullable ) ( TTUser *_Nonnull newUser ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
key |
user’s key. |
---|---|
secret |
user’s secret. |
agent |
Your unique client agent (provided by TigerText). |
success |
success return block. |
failure |
failure return block. |
Declared In
TTKitClass.h
– logout
Logout from TTKit. All local data, including Database and attachments, will be deleted. Session will be invalidaded and most of the API calls won’t function until a new login is done.
- (void)logout
Declared In
TTKitClass.h
+ version
TTKit Version.
+ (NSString *_Nonnull)version
Return Value
NSString conatining TTKit’s version.
Declared In
TTKitClass.h
– didReceiveRemoteNotification:fetchCompletionHandler:
Should be added to the method with the same name in your AppDelegate in order to support Background fetch for push notifications.
- (void)didReceiveRemoteNotification:(NSDictionary *_Nonnull)userInfo fetchCompletionHandler:(void ( ^ _Nullable ) ( UIBackgroundFetchResult ))completionHandler
Parameters
userInfo |
The remote notification payload identifier. |
---|---|
completionHandler |
The completion handler provided by the AppDelegate. |
Declared In
TTKitClass.h
– registerPushNotificationDataToken:
Register the device APNs token.
- (void)registerPushNotificationDataToken:(NSData *_Nonnull)dataToken
Parameters
dataToken |
device push token. |
---|
Declared In
TTKitClass.h
– registerVoipPushNotificationDataToken:
Register the device VoIP APNs token.
- (void)registerVoipPushNotificationDataToken:(NSData *_Nonnull)dataToken
Parameters
dataToken |
device VoIP push token. |
---|
Declared In
TTKitClass.h
Organization
– organizationsAccountsFetchControllerForOrganizationToken:delegate:
Organization Account fetchController will return all TTOrganizationAccount objects sorted by email Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)organizationsAccountsFetchControllerForOrganizationToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
Organization Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– organizationsFetchControllerWithDelegate:
Organization fetchController will return all TTOrganization objects sorted by organization name Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)organizationsFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
Organization Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– preferredEmailFetchControllerWithOrganizationToken:delegate:
Preferred email fetchController will return the selected/default TTOrganizationAccount with email object Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)preferredEmailFetchControllerWithOrganizationToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
organization Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– preferredPhoneFetchControllerWithOrganizationToken:delegate:
- Preferred phone fetchController will return the selected/default TTOrganizationAccount with phone number object. *
- @warning Must be called on the main thread only. *
- @param token organization Token.
- (NSFetchedResultsController *_Nullable)preferredPhoneFetchControllerWithOrganizationToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate. * * @return An ‘NSFetchedResultsController’ Object. * |
---|
Declared In
TTKitClass.h
– organizationAccountsEmailFetchControllerWithOrganizationToken:delegate:
Returns a NSFetchedResultsController with all TTOrganizationAccounts in which email isn’t nil.
- (NSFetchedResultsController *_Nullable)organizationAccountsEmailFetchControllerWithOrganizationToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
organization Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate object. |
Return Value
NSFetchedResultsController, results are sorted by email address.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– organizationAccountsPhoneFetchControllerWithOrganizationToken:delegate:
Returns a NSFetchedResultsController with all TTOrganizationAccounts in which phone isn’t nil.
- (NSFetchedResultsController *_Nullable)organizationAccountsPhoneFetchControllerWithOrganizationToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
organization Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate object. |
Return Value
NSFetchedResultsController, results are sorted by phone number.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– messageStatusFetchControllerForMessageToken:delegate:
Returns a NSFetchedResultsController with all TTMessageStatus related to a message, you can use this contorller to track multiple users statuses for a specific message.
- (NSFetchedResultsController *_Nullable)messageStatusFetchControllerForMessageToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
message Token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate object. |
Return Value
NSFetchedResultsController, results are sorted by phone number.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– currentOrganization
Returns the TTOrganization currently used.
- (TTOrganization *_Nullable)currentOrganization
Return Value
a TTOrganization Object.
Declared In
TTKitClass.h
– organizationWithToken:
Returns a TTOrganization object for the provided token.
- (TTOrganization *_Nullable)organizationWithToken:(NSString *_Nonnull)orgToken
Parameters
orgToken |
organization Token. |
---|
Return Value
A TTOrganization Object.
Declared In
TTKitClass.h
– getAllOrganizations
Retrieve all Organizations.
- (NSArray *_Nullable)getAllOrganizations
Return Value
An NSArray containing TTOrganization objects. If no TTOrganizations exists, an empty array will be returned.
Declared In
TTKitClass.h
– organizationIsPersonal:
Validate if a specific TTOrganization object is a personal organization.
- (BOOL)organizationIsPersonal:(TTOrganization *_Nonnull)anOrganization
Parameters
anOrganization |
A TTOrganization object. |
---|
Return Value
returns YES if provided TTOrganization is personal, NO otherwise.
Declared In
TTKitClass.h
– currentOrganizationToken
Returns the token of the current organization.
- (NSString *_Nullable)currentOrganizationToken
Return Value
NSString containing token of current organization.
Declared In
TTKitClass.h
– currentOrganizationName
Returns the name of the current organization.
- (NSString *_Nullable)currentOrganizationName
Return Value
NSString containing name of current organization.
Declared In
TTKitClass.h
– isCurrentOrganizationPersonal
Validate if current organization is a personal one.
- (BOOL)isCurrentOrganizationPersonal
Return Value
returns YES if current organization is personal, NO otherwise.
Declared In
TTKitClass.h
– setCurrentOrganization:
Set current organization.
- (void)setCurrentOrganization:(TTOrganization *_Nonnull)organization
Parameters
organization |
A TTOrganization object. |
---|
Declared In
TTKitClass.h
– joinOrganizationWithEmail:success:failure:
Add user to current organization by providing an email address linked with that organization.
- (void)joinOrganizationWithEmail:(NSString *_Nonnull)emailString success:(void ( ^ _Nullable ) ( TTOrganization *_Nonnull organization ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
emailString |
Email address. Must be valid and not empty or nil. |
---|---|
success |
Success block, returns newly created Organization object. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– leaveOrganization:success:failure:
Remove user from current organization by providing the organization token.
- (void)leaveOrganization:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
organizationToken |
Organization token. Must be valid and not empty or nil. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– unlinkEmail:success:failure:
Unlinks user email from current organization by providing an email address linked with that organization.
- (void)unlinkEmail:(NSString *_Nonnull)emailString success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
emailString |
Email address. Must be valid and not empty or nil. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
Users
– usersFetchControllerForCurrentOrganizationWithDelegate:
Users fetchController for organization will return all TTuser objects related to the current organization Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)usersFetchControllerForCurrentOrganizationWithDelegate:(id _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– usersFetchControllerWithGroupToken:delegate:
Users fetchController for group will return all TTuser objects related to the a TTGroup object Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)usersFetchControllerWithGroupToken:(NSString *_Nonnull)token delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
token |
TTGroup token. |
---|---|
delegate |
NSFetchedResultsControllerDelegate object. |
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– searchUsersLocally:success:
- Local search for Users Returns an array of TTUser objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTUser *
- @param search Search string.
- @param completionBlock Block which should handle the returned TTUser array. If no user is found, returned array will be empty.
- (void)searchUsersLocally:(NSString *_Nonnull)search success:(void ( ^ _Nullable ) ( NSArray *_Nullable users ))completionBlock
Declared In
TTKitClass.h
– searchUsers:params:success:
- Remote search for Users by the user’s display name Returns an array of TTUser objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTUser *
- @param search Search string.
- @param params Extra search parameters.
- @param completionBlock Block which should handle the returned TTUser array. If no user is found, returned array will be empty. The resultMetadata will contain some extra information about the search results such as
- the total number of possible results and pagniation data
- (void)searchUsers:(NSString *_Nonnull)search params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( NSArray *_Nullable users , NSDictionary *_Nullable resultMetadata ))completionBlock
Declared In
TTKitClass.h
– searchUsers:metatadaKey:params:success:
- Remote search for Users by the a metadata key Returns an array of TTUser objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTUser *
- @param search Search string.
- @param metadataKey metadataKey key to filter results by.
- @param params Extra search parameters.
- @param completionBlock Block which should handle the returned TTUser array. If no user is found, returned array will be empty. The resultMetadata will contain some extra information about the search results such as
- the total number of possible results and pagniation data
- (void)searchUsers:(NSString *_Nonnull)search metatadaKey:(NSString *_Nullable)metadataKey params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( NSArray *_Nullable users , NSDictionary *_Nullable resultMetadata ))completionBlock
Declared In
TTKitClass.h
– getRoomMembersWithGroup:continuationToken:success:
- get a paginated list of room members (Public group) Returns an array of TTUser objects. *
- @param group The room group object.
- @param continuationToken Pass in a continuation token to paginate results.
- @param completionBlock Block which should handle the returned TTUser array. If no user is found, returned array will be empty. The resultMetadata will contain some extra information about the search results such as
- the total number of possible results and pagniation data
- (void)getRoomMembersWithGroup:(TTGroup *_Nonnull)group continuationToken:(NSString *_Nullable)continuationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable users , NSDictionary *_Nullable resultMetadata ))completionBlock
Declared In
TTKitClass.h
– changePasswordFromCurrentPassword:newPassword:success:failure:
Change current user’s password to a new one.
- (void)changePasswordFromCurrentPassword:(NSString *_Nonnull)currentPassword newPassword:(NSString *_Nonnull)newPassword success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
currentPassword |
The user’s current password. |
---|---|
newPassword |
The user’s new password. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– resetPassword:success:failure:
Requests a reset password email to be sent to provided email address.
- (void)resetPassword:(NSString *_Nonnull)email success:(void ( ^ _Nullable ) ( NSString *_Nullable successReply ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
email |
Email must be valid and not empty or nil. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– downloadTigerTextUserWithPhoneNumberOrEmailAddress:success:failure:
Retrieve a TTUser by providing phone number or email address.
- (id _Nullable)downloadTigerTextUserWithPhoneNumberOrEmailAddress:(NSString *_Nonnull)phoneOrEmail success:(void ( ^ _Nullable ) ( TTUser *_Nonnull aUser ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
phoneOrEmail |
Phone number or email address. |
---|---|
success |
Success block, returns a TTUser object. |
failure |
Failure block, returns an NSError. |
Return Value
Returns an AFHTTPRequest operation if all values were valid, nil otherwise.
Declared In
TTKitClass.h
– updateLocalUserWithName:imageData:success:failure:
Update local user
- (id _Nullable)updateLocalUserWithName:(NSString *_Nullable)displayName imageData:(NSData *_Nullable)imageData success:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
displayName |
user’s display name. |
---|---|
imageData |
user’s avatar. |
success |
Success block, returns an updated User object. |
failure |
Failure block, returns an NSError. |
Declared In
TTKitClass.h
– updateLocalUserStatus:success:failure:
Update local user status
- (id _Nullable)updateLocalUserStatus:(NSString *_Nullable)status success:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
status |
user’s current status. |
---|---|
success |
Success block, returns an updated User object. |
failure |
Failure block, returns an NSError. |
Declared In
TTKitClass.h
– localUser
Retrieve the local user.
- (TTUser *_Nullable)localUser
Return Value
A TTUser object.
Declared In
TTKitClass.h
– userWithAddress:displayName:firstName:lastName:success:failure:
Retrieve a user from an email or phone number.
- (void)userWithAddress:(NSString *_Nullable)userAddress displayName:(NSString *_Nullable)displayName firstName:(NSString *_Nullable)firstName lastName:(NSString *_Nullable)lastName success:(void ( ^ _Nullable ) ( NSString *_Nullable userToken ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
userAddress |
A valid email or phone number. |
---|---|
displayName |
The (possibly) new user display name. |
firstName |
The (possibly) new user first name. |
lastName |
The (possibly) new user last name. |
success |
Success block, returns the retrieved user token. |
failure |
Failure block, returns an NSError. |
Discussion
If you want to send a TigerText message to an email of phone number (Message Anyone
) use this method to retrieve a
TigerText user token you would be able to message
Declared In
TTKitClass.h
– userWithToken:
Retrieve a user for the provided token.
- (TTUser *_Nullable)userWithToken:(NSString *_Nonnull)token
Parameters
token |
A user token. |
---|
Return Value
A TTUser object with the provided token.
Declared In
TTKitClass.h
– getPresenceDataForUserToken:
Retrieve TTPresenceData by the user’s token.
- (TTPresenceData *_Nullable)getPresenceDataForUserToken:(NSString *_Nonnull)token
Parameters
token |
User’s token. |
---|
Return Value
A TTPresenceData object.
Declared In
TTKitClass.h
– isUserConnected
Validates the presence of session credentials.
- (BOOL)isUserConnected
Return Value
YES if session is valid, NO otherwise.
Declared In
TTKitClass.h
– downloadDetailsForUserToken:success:failure:
Downloads user details. Results will be persisted to the local data store.
- (id _Nullable)downloadDetailsForUserToken:(NSString *_Nonnull)token success:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
token |
TTUser token. |
---|---|
success |
Success block. |
failure |
Failure block, returns an NSError. |
Declared In
TTKitClass.h
– downloadDetailsForUser:success:failure:
Downloads user details. Results will be persisted to the local data store.
- (id _Nullable)downloadDetailsForUser:(TTUser *_Nonnull)aUser success:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
success |
Success block. |
---|---|
failure |
Failure block, returns an NSError. |
token |
TTUser object. |
Declared In
TTKitClass.h
Groups
– groupsFetchControllerWithDelegate:
Groups fetchController will return all TTGroup objects related to the current organization Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)groupsFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– publicGroupsFetchControllerWithDelegate:
Public Groups fetchController will return all public groups related to the current organization with Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)publicGroupsFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– privateGroupsFetchControllerWithDelegate:
Private Groups fetchController will return all private groups related to the current organization with Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)privateGroupsFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– broadcastListGroupsFetchControllerWithDelegate:
Broadcast List Groups fetchController will return all broadcast list groups related to the current organization with Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)broadcastListGroupsFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– createGroupWithName:membersTokens:avatarUrl:imageData:replayHistory:success:failure:
Create a new TTGroup.
- (void)createGroupWithName:(NSString *_Nullable)groupName membersTokens:(NSArray *_Nullable)membersTokens avatarUrl:(NSString *_Nullable)avatarUrl imageData:(NSData *_Nullable)imageData replayHistory:(BOOL)replayHistory success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
groupName |
Name of the new group (NSString). |
---|---|
membersTokens |
NSArray of user tokens. When nil no members will be added to the group, when empty only local user will be added. |
avatarUrl |
NSString containing the group avatar’s URL. |
imageData |
NSData containing the group avatar’s image. |
replayHistory |
BOOL, show group history when new users join. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Local user will be added as a memeber of the resulting group unless nil was passed for memberTokens array.
Declared In
TTKitClass.h
– createGroupWithName:membersTokens:avatarUrl:imageData:asRole:replayHistory:success:failure:
Create a new TTGroup.
- (void)createGroupWithName:(NSString *_Nullable)groupName membersTokens:(NSArray *_Nullable)membersTokens avatarUrl:(NSString *_Nullable)avatarUrl imageData:(NSData *_Nullable)imageData asRole:(TTRole *_Nullable)role replayHistory:(BOOL)replayHistory success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
groupName |
Name of the new group (NSString). |
---|---|
membersTokens |
NSArray of user tokens. When nil no members will be added to the group, when empty only local user will be added. |
avatarUrl |
NSString containing the group avatar’s URL. |
imageData |
NSData containing the group avatar’s image. |
role |
If you wish to create this group as a role pass in the TTRole object |
replayHistory |
BOOL, show group history when new users join. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Local user will be added as a memeber of the resulting group unless nil was passed for memberTokens array.
Declared In
TTKitClass.h
– createGroupWithName:membersTokens:avatarUrl:imageData:metadata:replayHistory:success:failure:
Create a new TTGroup with metadata.
- (void)createGroupWithName:(NSString *_Nullable)groupName membersTokens:(NSArray *_Nullable)membersTokens avatarUrl:(NSString *_Nullable)avatarUrl imageData:(NSData *_Nullable)imageData metadata:(NSDictionary *_Nullable)metadata replayHistory:(BOOL)replayHistory success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
groupName |
Name of the new group (NSString). |
---|---|
membersTokens |
NSArray of user tokens. When nil no members will be added to the group, when empty only local user will be added. |
avatarUrl |
NSString containing the group avatar’s URL. |
imageData |
NSData containing the group avatar’s image. |
metadata |
NSDictionary keys and values you wish to add to the group (i.e key1 : value1, key2 : value2). |
replayHistory |
BOOL, show group history when new users join. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Local user will be added as a memeber of the resulting group unless nil was passed for memberTokens array.
Declared In
TTKitClass.h
– createGroupWithName:membersTokens:avatarUrl:imageData:asRole:metadata:replayHistory:success:failure:
Create a new TTGroup with metadata.
- (void)createGroupWithName:(NSString *_Nullable)groupName membersTokens:(NSArray *_Nullable)membersTokens avatarUrl:(NSString *_Nullable)avatarUrl imageData:(NSData *_Nullable)imageData asRole:(TTRole *_Nullable)role metadata:(NSDictionary *_Nullable)metadata replayHistory:(BOOL)replayHistory success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
groupName |
Name of the new group (NSString). |
---|---|
membersTokens |
NSArray of user tokens. When nil no members will be added to the group, when empty only local user will be added. |
avatarUrl |
NSString containing the group avatar’s URL. |
imageData |
NSData containing the group avatar’s image. |
role |
If you wish to create this group as a role pass in the TTRole object |
metadata |
NSDictionary keys and values you wish to add to the group (i.e key1 : value1, key2 : value2). |
replayHistory |
BOOL, show group history when new users join. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Local user will be added as a memeber of the resulting group unless nil was passed for memberTokens array.
Declared In
TTKitClass.h
– createPublicGroupWithName:membersTokens:avatarUrl:imageData:groupDescription:replayHistory:success:failure:
Create a new Public TTGroup.
- (void)createPublicGroupWithName:(NSString *_Nullable)groupName membersTokens:(NSArray *_Nullable)membersTokens avatarUrl:(NSString *_Nullable)avatarUrl imageData:(NSData *_Nullable)imageData groupDescription:(NSString *_Nullable)groupDescription replayHistory:(BOOL)replayHistory success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
groupName |
Name of the new group (NSString). |
---|---|
membersTokens |
NSArray of user tokens. When nil no members will be added to the group, when empty only local user will be added. |
avatarUrl |
NSString containing the group avatar’s URL. |
imageData |
NSData containing the group avatar’s image. |
groupDescription |
Public group description (Max 300 Characters). |
replayHistory |
BOOL, show group history when new users join. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Local user will be added as a memeber of the resulting group unless nil was passed for memberTokens array.
Declared In
TTKitClass.h
– updateGroupWithToken:groupName:avatar:success:failure:
Update a group.
- (void)updateGroupWithToken:(NSString *_Nullable)token groupName:(NSString *_Nullable)groupName avatar:(NSData *_Nullable)imageData success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
token |
Group token. |
---|---|
groupName |
Group name. |
imageData |
NSData containing the group avatar’s image. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Return Value
a ‘TTGroup’ object
Declared In
TTKitClass.h
– updateRoomWithToken:groupName:avatar:roomDescription:success:failure:
Update a public group (Room).
- (void)updateRoomWithToken:(NSString *_Nullable)token groupName:(NSString *_Nullable)groupName avatar:(NSData *_Nullable)imageData roomDescription:(NSString *_Nullable)roomDescription success:(void ( ^ _Nullable ) ( TTGroup *_Nullable newGroup ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
token |
Public group token. |
---|---|
groupName |
Public group name. |
imageData |
NSData containing the group avatar’s image. |
roomDescription |
Room description (Max 300 Characters). |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Return Value
a ‘TTGroup’ object
Declared In
TTKitClass.h
– addUserToGroup:user:success:failure:
- (void)addUserToGroup:(TTGroup *_Nonnull)group user:(TTUser *_Nonnull)user success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
A TTGroup object. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
users |
A TTUser object. |
Declared In
TTKitClass.h
– addUsersToGroup:users:success:failure:
Add multiple TTUsers to a TTGroup.
- (void)addUsersToGroup:(TTGroup *_Nonnull)group users:(NSArray *_Nonnull)users success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
A TTGroup object. |
---|---|
users |
An NSArray of TTUser objects. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– addUsersToGroup:userTokens:success:failure:
Add multiple TTUsers to a TTGroup.
- (void)addUsersToGroup:(TTGroup *_Nonnull)group userTokens:(NSArray *_Nonnull)userTokens success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
A TTGroup object. |
---|---|
userTokens |
An NSArray of TTUser objects tokens. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– leaveGroup:
Leave group. Removes local user from group
- (void)leaveGroup:(TTGroup *_Nonnull)group
Parameters
group |
A TTGroup object. |
---|
Declared In
TTKitClass.h
– joinGroup:success:failure:
Join group. Adds local user to a group
- (void)joinGroup:(TTGroup *_Nonnull)group success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
A TTGroup object. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– removeUsersFromGroup:users:success:failure:
Remove an array of TTUsers from a TTGroup.
- (void)removeUsersFromGroup:(TTGroup *_Nonnull)group users:(NSArray *_Nonnull)users success:(void ( ^ _Nullable ) ( TTGroup *_Nonnull group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
A TTGroup object. |
---|---|
users |
An NSArray of TTUser objects. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– searchGroups:success:
- Remote group search Returns an array of TTGroup objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTGroup *
- @param search Search string.
- @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty.
- (void)searchGroups:(NSString *_Nonnull)search success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups ))completionBlock
Declared In
TTKitClass.h
– searchGroups:params:success:
- Remote group search Returns an array of TTGroup objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTGroup *
- @param search Search string.
- @param params NSDictionary with additional search parameters.
- @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty.
- (void)searchGroups:(NSString *_Nonnull)search params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups ))completionBlock
Declared In
TTKitClass.h
– searchPrivateGroups:success:failure:
* Private group search Returns an array of TTGroup objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTGroup * * @param search Search string. * @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty. * @param failure Failure block, returns an NSError.
- (void)searchPrivateGroups:(NSString *_Nonnull)search success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups ))completionBlock failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Declared In
TTKitClass.h
– searchPublicGroups:continuationToken:success:failure:
* Public group search Returns an array of TTGroup objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTGroup * * @param search Search string. * @param continuationToken Pass in a continuation token to paginate results. * @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty. * @param failure Failure block, returns an NSError.
- (void)searchPublicGroups:(NSString *_Nullable)search continuationToken:(NSString *_Nullable)continuationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups , NSDictionary *_Nullable resultMetadata ))completionBlock failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Declared In
TTKitClass.h
– searchBroadcastListGroups:continuationToken:success:failure:
* Broadcast List group search Returns an array of TTGroup objects with a displayName containing the search string which are a part of the user’s current organization. Returned objects are TTGroup * * @param search Search string. * @param continuationToken Pass in a continuation token to paginate results. * @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty. * @param failure Failure block, returns an NSError.
- (void)searchBroadcastListGroups:(NSString *_Nonnull)search continuationToken:(NSString *_Nullable)continuationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups , NSDictionary *_Nullable resultMetadata ))completionBlock failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Declared In
TTKitClass.h
– searchGroups:metatadaKey:success:
- Remote search for Groups by the a metadata key Returns an array of TTGroup objects with a metadata key containing the search string which are a part of the user’s current organization. Returned objects are TTGroup *
- @param search Search string.
- @param metadataKey metadataKey key to filter results by.
- @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty.
- (void)searchGroups:(NSString *_Nonnull)search metatadaKey:(NSString *_Nonnull)metadataKey success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups ))completionBlock
Declared In
TTKitClass.h
– searchGroups:metatadaKey:params:success:
- Remote search for Groups by the a metadata key Returns an array of TTGroup objects with a metadata key containing the search string which are a part of the user’s current organization. Returned objects are TTGroup *
- @param search Search string.
- @param metadataKey metadataKey key to filter results by.
- @param params NSDictionary with additional search parameters.
- @param completionBlock Block which should handle the returned TTGroup array. If no user is found, returned array will be empty.
- (void)searchGroups:(NSString *_Nonnull)search metatadaKey:(NSString *_Nonnull)metadataKey params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( NSArray *_Nullable groups ))completionBlock
Declared In
TTKitClass.h
– deleteGroup:
Delete a group
- (void)deleteGroup:(TTGroup *_Nonnull)group
Parameters
group |
TTGroup object |
---|
Declared In
TTKitClass.h
– downloadDetailsForGroup:success:failure:
Downloads group details. Results will be persisted to the local data store.
- (id _Nullable)downloadDetailsForGroup:(TTGroup *_Nonnull)aGroup success:(void ( ^ _Nullable ) ( TTGroup *_Nullable group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
success |
Success block. |
---|---|
failure |
Failure block, returns an NSError. |
token |
TTGroup object. |
Declared In
TTKitClass.h
Roster
– rosterFetchControllerWithDelegate:
Roster fetchController will return all TTRosterEntry objects for current organization sorted by last message timestamp Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)rosterFetchControllerWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– rosterFetchControllerForAllOrganizationsWithDelegate:
Roster fetchController will return all TTRosterEntry objects for ALL organizations sorted by last message timestamp Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)rosterFetchControllerForAllOrganizationsWithDelegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate object. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Declared In
TTKitClass.h
– rosterFetchControllerForAllOrganizationsMetadataKey:metadataValue:delegate:
Roster fetchController will return all TTRosterEntry objects for ALL organizations sorted by last message timestamp for a given metadata key-value pair. Must be called on the main thread only.
- (NSFetchedResultsController *_Nullable)rosterFetchControllerForAllOrganizationsMetadataKey:(NSString *_Nonnull)key metadataValue:(NSString *_Nonnull)value delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
- @param key metadata key.
- @param value metadata value.
- @param delegate NSFetchedResultsControllerDelegate object.
Declared In
TTKitClass.h
– rosterFetchControllerdWithMetadataKey:metadataValue:organizationToken:delegate:
Roster fetchController will return TTRosterEntry objects for organization token sorted by last message timestamp for a given metadata key-value pair.
- (NSFetchedResultsController *_Nullable)rosterFetchControllerdWithMetadataKey:(NSString *_Nonnull)key metadataValue:(NSString *_Nonnull)value organizationToken:(NSString *_Nonnull)organizationToken delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
key |
metadata key. |
---|---|
value |
metadata value. |
organizationToken |
the relevant TTOrganization token. |
delegate |
NSFetchedResultsControllerDelegate object. |
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– searchRosterEntriesWithString:success:
Filter TTRosterEntries by search string.
- (void)searchRosterEntriesWithString:(NSString *_Nonnull)search success:(void ( ^ _Nullable ) ( NSArray *_Nullable rosterEntries ))completionBlock
Parameters
search |
The search term (NSString). |
---|---|
completionBlock |
Called upon query’s completion. The rosterEntries NSArray contains the resulting TTRosterEntry objects, and will be empty if query had no results. |
Discussion
Returns an NSArray of TTRosterEntry objects which passes one of the following string comparisons:
- Its displayName property contains the search string.
- Its target’s displayName contains the search string.
- Its target’s metadata value contains the search string.
Note that all of the above are case and diacritic insensitive.
Declared In
TTKitClass.h
– rosterEntryWithConversationHash:
Retrieve a TTRosterEntry by its conversationHash.
- (TTRosterEntry *_Nullable)rosterEntryWithConversationHash:(NSString *_Nonnull)conversationHash
Parameters
conversationHash |
An NSString with the conversationHash. |
---|
Return Value
A TTRosterEntry with the conversationHash or nil if conversationHash was nil, empty or no TTRosterEntry has the conversationHash.
Declared In
TTKitClass.h
– deleteRosterEntry:
Delete a TTRosterEntry.
- (void)deleteRosterEntry:(TTRosterEntry *_Nonnull)entry
Parameters
entry |
A TTRosterEntry to be deleted. |
---|
Declared In
TTKitClass.h
– rosterEntryForUser:
Retrieve Roster Entry with user, this could be use to access the conversation screen from the user’s contacts
- (TTRosterEntry *_Nullable)rosterEntryForUser:(TTUser *_Nonnull)user
Parameters
user |
TTUser object |
---|
Return Value
An ‘TTRosterEntry’ object
Declared In
TTKitClass.h
– rosterEntryForUser:organizationToken:
Retrieve Roster Entry with user, this could be use to access the conversation screen from the user’s contacts
- (TTRosterEntry *_Nullable)rosterEntryForUser:(TTUser *_Nonnull)user organizationToken:(NSString *_Nonnull)organizationToken
Parameters
user |
TTUser object |
---|---|
organizationToken |
An organization token |
Return Value
An ‘TTRosterEntry’ object
Declared In
TTKitClass.h
– rosterEntryForUsersTokens:
Retrieve Roster Entry for a set of user token, this could be use to access the conversation screen from the user’s groups
- (TTRosterEntry *_Nullable)rosterEntryForUsersTokens:(NSArray *_Nonnull)tokenArray
Parameters
user |
TTUser object |
---|
Return Value
An ‘TTRosterEntry’ object
Declared In
TTKitClass.h
– rosterEntryForGroup:
Retrieve Roster Entry with group, this could be use to access the conversation screen from the user’s contacts
- (TTRosterEntry *_Nullable)rosterEntryForGroup:(TTGroup *_Nonnull)group
Parameters
group |
TTGroup object |
---|
Return Value
An ‘TTRosterEntry’ object
Declared In
TTKitClass.h
– rosterEntryForRoleRecipient:organizationToken:
Retrieve Roster Entry for a conversation between a role and the local user.
- (TTRosterEntry *_Nullable)rosterEntryForRoleRecipient:(TTRole *_Nonnull)roleRecipient organizationToken:(NSString *_Nonnull)organizationToken
Parameters
roleRecipient |
The conversation role recipient. |
---|---|
organizationToken |
An organization token, will default to current organization if not provided. |
Return Value
An ‘TTRosterEntry’ object.
Declared In
TTKitClass.h
– rosterEntryForRoleSender:roleRecipient:organizationToken:
Retrieve Roster Entry for a conversation between two roles.
- (TTRosterEntry *_Nullable)rosterEntryForRoleSender:(TTRole *_Nullable)roleSender roleRecipient:(TTRole *_Nonnull)roleRecipient organizationToken:(NSString *_Nonnull)organizationToken
Parameters
roleSender |
The conversation role sender or the role who created this conversation. |
---|---|
roleRecipient |
The conversation role recipient. |
organizationToken |
An organization token, will default to current organization if not provided. |
Return Value
An ‘TTRosterEntry’ object.
Declared In
TTKitClass.h
– rosterEntryForRoleSender:userRecipient:organizationToken:
Retrieve Roster Entry for a conversation a role (sender) and a user.
- (TTRosterEntry *_Nullable)rosterEntryForRoleSender:(TTRole *_Nullable)roleSender userRecipient:(TTUser *_Nonnull)userRecipient organizationToken:(NSString *_Nonnull)organizationToken
Parameters
roleSender |
The conversation role sender or the role who created this conversation. |
---|---|
userRecipient |
The conversation user recipient. |
organizationToken |
An organization token, will default to current organization if not provided. |
Return Value
An ‘TTRosterEntry’ object.
Declared In
TTKitClass.h
– isRosterEntryTigerPage:
Determine whether the roster entry is TigerPage
- (BOOL)isRosterEntryTigerPage:(TTRosterEntry *_Nonnull)entry
Parameters
A |
TTRosterEntry to compare |
---|
Return Value
returns YES if provided TTRosterEntry is tigerpage, NO otherwise.
Declared In
TTKitClass.h
– isTokenTigerPage:
Validate if provided token is Tigerpage.
- (BOOL)isTokenTigerPage:(NSString *_Nonnull)token
Parameters
token |
A token to compare |
---|
Return Value
YES if provided token is Tigerpage, NO otherwise.
Declared In
TTKitClass.h
– getAllRosterEntries
Fetch all TTRosterEntry objects
- (NSArray *_Nullable)getAllRosterEntries
Return Value
NSArray object with all TTRosterEntry objects
Declared In
TTKitClass.h
– conversationHashWithSenderToken:senderOrgToken:recipientOrgToken:
Get conversation hash for a specific peer-to-peer conversation.
- (NSString *_Nonnull)conversationHashWithSenderToken:(NSString *_Nonnull)aSenderToken senderOrgToken:(NSString *_Nonnull)aSenderOrgToken recipientOrgToken:(NSString *_Nonnull)aRecipientOrgToken
Parameters
aSenderToken |
A sender token @param aSenderOrgToken @param aRecipientOrgToken |
---|
Return Value
an NSString of the conversationHash
Declared In
TTKitClass.h
– conversationHashWithGroupToken:
Get conversation hash for a specific group conversation.
- (NSString *_Nonnull)conversationHashWithGroupToken:(NSString *_Nonnull)aGroupToken
Parameters
aGroupToken |
A sender token |
---|
Return Value
an NSString of the conversationHash
Declared In
TTKitClass.h
Shift
– userShiftsWithToken:startDate:endDate:organizationToken:success:failure:
Fetch a TTUser roles schedule.
- (id _Nullable)userShiftsWithToken:(NSString *_Nonnull)userToken startDate:(NSDate *_Nonnull)startDate endDate:(NSDate *_Nonnull)endDate organizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( NSArray<TTShift*> *_Nullable shifts ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
userToken |
user token. |
---|---|
startDate |
Schedule start time. |
endDate |
Schedule end time. |
organizationToken |
organization token. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Use this method to pull fresh data from the scheduling server. The shifts returned will contain all the roles that the user you provided is scheduled to be assigned to.
Declared In
TTKitClass.h
– roleShiftsWithToken:startDate:endDate:organizationToken:success:failure:
Fetch a TTRole users schedule.
- (id _Nullable)roleShiftsWithToken:(NSString *_Nonnull)roleToken startDate:(NSDate *_Nonnull)startDate endDate:(NSDate *_Nonnull)endDate organizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( NSArray<TTShift*> *_Nullable shifts ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
roleToken |
role token. |
---|---|
startDate |
Schedule start time. |
endDate |
Schedule end time. |
organizationToken |
organization token. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
Use this method to pull fresh data from the scheduling server. The shifts returned will contain all the users that are scheduled to be assigned to the role you provided
Declared In
TTKitClass.h
– isCalendarServiceEnabledForOrganization:
Use this method to check if calendar service is enabled for any Organization.
- (BOOL)isCalendarServiceEnabledForOrganization:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
The organization token for which to check for calendar service feature. |
---|
Declared In
TTKitClass.h
Messages
– forwardMessage:asRole:recipient:success:failure:
Forward a message to a user.
- (void)forwardMessage:(NSString *_Nonnull)messageToken asRole:(TTRole *_Nullable)role recipient:(NSString *_Nonnull)recipientToken success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageToken |
message token. |
---|---|
role |
The TTRole object you wish to send as |
recipientToken |
user or group token. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
if a message is marked with TTMessagePriorityHigh, same priority will be conserved when forwarding. Otherwise TTMessagePriorityNormal will be used.
Declared In
TTKitClass.h
– forwardMessage:asRole:recipient:priorityMessage:success:failure:
Forward a message to a user.
- (void)forwardMessage:(NSString *_Nonnull)messageToken asRole:(TTRole *_Nullable)role recipient:(NSString *_Nonnull)recipientToken priorityMessage:(TTMessagePriority)priorityMessage success:(void ( ^ _Nullable ) ( TTGroup *_Nullable group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageToken |
message token. |
---|---|
role |
The TTRole object you wish to send as |
recipientToken |
user or group token. |
priorityMessage |
priority type for this message. |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Discussion
priority cannot be downgraded, meaning that if a message is marked with TTMessagePriorityHigh, same priority will be conserved even if TTMessagePriorityNormal will be used.
Declared In
TTKitClass.h
– forwardMessages:asRole:recipient:priorityMessage:success:failure:
Forward messages to a user.
- (void)forwardMessages:(NSArray<NSString*> *_Nonnull)messageTokens asRole:(TTRole *_Nullable)roleSender recipient:(NSString *_Nonnull)recipient priorityMessage:(TTMessagePriority)priority success:(void ( ^ _Nullable ) ( TTGroup *_Nullable group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageTokens |
message tokens. |
---|---|
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
priorityMessage |
priority type for this message. |
recipientToken |
user or group token. |
role |
The TTRole object you wish to send as |
Declared In
TTKitClass.h
– forwardMessage:asRole:toUsers:success:failure:
Forward a message to group of users, creating a group in the process.
- (void)forwardMessage:(NSString *_Nonnull)messageToken asRole:(TTRole *_Nullable)role toUsers:(NSArray *_Nonnull)users success:(void ( ^ _Nullable ) ( TTGroup *_Nullable group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageToken |
message token. |
---|---|
users |
array of users to send to |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– forwardMessages:asRole:toUsers:success:failure:
Forward messages to group of users, creating a group in the process.
- (void)forwardMessages:(NSArray<NSString*> *_Nonnull)messageTokens asRole:(TTRole *_Nullable)asRole toUsers:(NSArray *_Nonnull)users success:(void ( ^ _Nullable ) ( TTGroup *_Nullable group ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageTokens |
message tokens. |
---|---|
users |
array of users to send to |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– sendMessageWithRequest:completion:
Send a message using TTMessageRequest object.
- (void)sendMessageWithRequest:(TTMessageRequest *_Nonnull)messageRequest completion:(void ( ^ _Nullable ) ( TTMessage *_Nullable message , NSError *_Nullable error ))completion
Parameters
messageRequest |
TTMessageRequest object. |
---|---|
completion |
The completion block, will return the new created message or an NSError. |
Declared In
TTKitClass.h
– retrySendingMessage:
Retry sending message will try to send the message again (usually used for failed messages)
- (void)retrySendingMessage:(TTMessage *_Nonnull)message
Parameters
message |
message object. |
---|
Declared In
TTKitClass.h
– resendMessage:
Resend message will create a new duplicate message.
- (void)resendMessage:(TTMessage *_Nonnull)message
Parameters
message |
message object. |
---|
Declared In
TTKitClass.h
– markAllUnreadMessagesAsReadForConversationHash:isGroup:success:failure:
Mark all unread message for roster entry (conversation) as read.
- (void)markAllUnreadMessagesAsReadForConversationHash:(NSString *_Nonnull)conversationHash isGroup:(BOOL)isGroup success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
conversationHash |
Conversation Hash. |
---|---|
isGroup |
is the conversation a group conversation. |
success |
success return block. |
failure |
failure return block. |
Declared In
TTKitClass.h
– markAllUnreadMessagesAsRead:success:failure:
Mark all unread message for roster entry (conversation) as read.
- (void)markAllUnreadMessagesAsRead:(TTRosterEntry *_Nonnull)rosterEntry success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
rosterEntry |
roster entry (conversation) object. |
---|---|
success |
success return block. |
failure |
failure return block. |
Declared In
TTKitClass.h
– markMessageAsRead:
Mark message status as Read.
- (void)markMessageAsRead:(TTMessage *_Nonnull)message
Parameters
message |
TTMessage object. |
---|
Declared In
TTKitClass.h
– markMessagesAsRead:
Mark message statuses as Read
- (void)markMessagesAsRead:(NSArray<TTMessage*> *_Nonnull)messages
Parameters
messages |
Array of TTMessage objects. |
---|
Declared In
TTKitClass.h
– allUnreadMessagesForConversationHash:
Return all the unread messages for a specific conversation using the default NSManagedObjectContext.
- (NSArray *_Nullable)allUnreadMessagesForConversationHash:(NSString *_Nonnull)conversationHash
Parameters
conversationHash |
conversationHash for the conversation |
---|
Declared In
TTKitClass.h
– conversationFetchControllerWithConversationHash:includeBangs:delegate:
Conversation fetchController will return ALL TTMessage objects sorted by message creation date.
- (NSFetchedResultsController *_Nullable)conversationFetchControllerWithConversationHash:(NSString *_Nonnull)conversationHash includeBangs:(BOOL)includeBangs delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
conversationHash |
roster entry conversation hash. |
---|---|
includeBangs |
set this flag to recieve bang event messages in the conversation (i.e ‘username has left the group’). |
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
Warning: Must be called on the main thread only.
Warning: This will return ALL the messages for that conversation, to maximize performance we suggest you use ‘conversationFetchControllerWithConversationHash:fetchLimit:batchSize:offset:delegate:’ to load a smaller subset and paginate through.
Declared In
TTKitClass.h
– conversationFetchControllerWithConversationHash:fetchLimit:batchSize:includeBangs:offset:delegate:
Conversation fetchController will return TTMessage objects sorted by message creation date.
- (NSFetchedResultsController *_Nullable)conversationFetchControllerWithConversationHash:(NSString *_Nonnull)conversationHash fetchLimit:(NSUInteger)fetchLimit batchSize:(NSUInteger)batchSize includeBangs:(BOOL)includeBangs offset:(NSUInteger)offset delegate:(id<NSFetchedResultsControllerDelegate> _Nullable)delegate
Parameters
conversationHash |
roster entry conversation hash. |
---|---|
fetchLimit |
max results to returned. |
batchSize |
max batch size. |
includeBangs |
set this flag to recieve bang event messages in the conversation (i.e ‘username has left the group’). |
offset |
message offset. |
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– deleteMessages:
Delete multiple TTMessages.
- (void)deleteMessages:(NSArray<TTMessage*> *_Nonnull)messages
Parameters
messages |
an array of TTMessage objects to be deleted. |
---|
Declared In
TTKitClass.h
– deleteAllMessageForRosterEntry:
Delete all messages for roster entry.
- (void)deleteAllMessageForRosterEntry:(TTRosterEntry *_Nonnull)entry
Parameters
entry |
roster entry object. |
---|
Declared In
TTKitClass.h
Metadata
– addMetadataForGroup:params:success:failure:
Adding Metadata to group
- (id _Nullable)addMetadataForGroup:(TTGroup *_Nonnull)group params:(NSDictionary *_Nonnull)params success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
TTGroup object. |
---|---|
params |
metadata keys and values you wish to add to the group (i.e key1 : value1, key2 : value2). |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– setMetadataForGroup:params:success:failure:
Setting Metadata to group
- (id _Nullable)setMetadataForGroup:(TTGroup *_Nonnull)group params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
TTGroup object. |
---|---|
params |
metadata keys and values you wish to set as the group’s metadata (i.e key1 : value1, key2 : value2). This will override previous values |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– addMetadataForUser:organizationToken:params:success:failure:
Adding Metadata to user
- (id _Nullable)addMetadataForUser:(TTUser *_Nonnull)user organizationToken:(NSString *_Nonnull)organizationToken params:(NSDictionary *_Nonnull)params success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
user |
TTUser object. |
---|---|
organizationToken |
The organization token you wish to add Metadata, Must be valid and not empty or nil. |
params |
metadata keys and values you wish to add to the user (i.e key1 : value1, key2 : value2). |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– setMetadataForUser:organizationToken:params:success:failure:
Setting Metadata to user
- (id _Nullable)setMetadataForUser:(TTUser *_Nonnull)user organizationToken:(NSString *_Nonnull)organizationToken params:(NSDictionary *_Nullable)params success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
user |
TTUser object. |
---|---|
organizationToken |
The organization token you wish to set Metadata, Must be valid and not empty or nil. |
params |
metadata keys and values you wish to set as the user’s metadata (i.e key1 : value1, key2 : value2). This will override previous values |
success |
Success block. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– getMetadataForUser:organizationToken:success:failure:
Getting Metadata of user
- (id _Nullable)getMetadataForUser:(TTUser *_Nonnull)user organizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable results ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
user |
TTUser object. |
---|---|
organizationToken |
The organization token you wish to get Metadata, Must be valid and not empty or nil. |
success |
Success block with metadata results. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– getMetadataForGroup:success:failure:
Getting Metadata of group
- (id _Nullable)getMetadataForGroup:(TTGroup *_Nonnull)group success:(void ( ^ _Nullable ) ( NSArray *_Nullable results ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
group |
TTGroup object. |
---|---|
success |
Success block with metadata results. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– getMetadataForRosterEntry:success:failure:
Getting Metadata of conversation
- (id _Nullable)getMetadataForRosterEntry:(TTRosterEntry *_Nonnull)roster success:(void ( ^ _Nullable ) ( NSArray *_Nullable results ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
roster |
TTRosterEntry object. |
---|---|
success |
Success block with metadata results. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
Roles
– savedRolesFetchedResultsControllerWithOrganizationToken:tagTokens:delegate:
Saved roles fetchController will return all TTRole objects with saved = YES, sorted by name.
- (NSFetchedResultsController *_Nullable)savedRolesFetchedResultsControllerWithOrganizationToken:(NSString *_Nonnull)organizationToken tagTokens:(NSArray *_Nullable)tagTokens delegate:(id _Nullable)delegate
Parameters
organizationToken |
The organization token you wish to fetch from, will default to current organization if not provided. |
---|---|
tagTokens |
Filter results with an Array of TTTag tokens. |
delegate |
NSFetchedResultsControllerDelegate. |
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– savedRolesForOrganizationToken:completion:
Fetch/refresh the complete list of the user’s saved roles.
- (id _Nullable)savedRolesForOrganizationToken:(NSString *_Nonnull)organizationToken completion:(void ( ^ _Nullable ) ( NSArray *_Nullable savedRoles , BOOL success , NSError *_Nullable error ))completion
Parameters
organizationToken |
The organization token, will default to current organization token. |
---|---|
completion |
Called upon query’s completion. |
Declared In
TTKitClass.h
– updateSaveForRole:save:completion:
Update Role saved property, use this to bookmark a role to the list of your saved (favorite) roles.
- (void)updateSaveForRole:(TTRole *_Nonnull)role save:(BOOL)save completion:(void ( ^ _Nullable ) ( BOOL success , NSError *_Nullable error ))completion
Parameters
role |
The TTRole objects you wish to update |
---|---|
completion |
Called upon query’s completion. |
Declared In
TTKitClass.h
– searchSavedRoles:organizationToken:success:
Filter Saved TTRole object with search string.
- (void)searchSavedRoles:(NSString *_Nonnull)searchString organizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable results ))completionBlock
Parameters
searchString |
The search term (NSString). |
---|---|
organizationToken |
The organization token you wish to perform the search, will default to current organization if not provided. |
completionBlock |
Called upon query’s completion. The rosterEntries NSArray contains the resulting TTRosterEntry objects, and will be empty if query had no results. |
Discussion
Returns an NSArray of TTRole objects which passes one of the following string comparisons:
- Its displayName property contains the search string.
Note that all of the above are case and diacritic insensitive.
Declared In
TTKitClass.h
– searchRoles:filterTagTokens:organizationToken:continuationToken:success:failure:
Search Roles in an organization.
- (id _Nullable)searchRoles:(NSString *_Nonnull)searchTerm filterTagTokens:(NSArray *_Nullable)tagTokens organizationToken:(NSString *_Nonnull)organizationToken continuationToken:(NSString *_Nullable)continuationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable roles , NSDictionary *_Nullable resultMetadata ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
organizationToken |
The organization token you wish to perform the search, will default to current organization if not provided. |
---|---|
continuationToken |
Pass in a continuation token to paginate results. |
filterTagTokens |
An Array of TTTag tokens (NSString) you wish to filter by. |
completionBlock |
Block which should handle the returned TTRole array. If no role is found, returned array will be empty. The resultMetadata will contain some extra information about the search results such as the total number of possible results and pagniation data |
searchString |
The search term (NSString). |
Discussion
Returns an NSArray of TTRole objects which passes one of the following string comparisons:
- Its displayName property contains the search string. *
Declared In
TTKitClass.h
– searchTags:filterColorTokens:organizationToken:continuationToken:success:failure:
Search Tags in an organization.
- (id _Nullable)searchTags:(NSString *_Nullable)searchString filterColorTokens:(NSArray *_Nullable)colorTokens organizationToken:(NSString *_Nonnull)organizationToken continuationToken:(NSString *_Nullable)continuationToken success:(void ( ^ _Nullable ) ( NSArray<TTTag*> *_Nullable tags , NSDictionary *_Nullable resultMetadata ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
searchString |
The search term (NSString). |
---|---|
organizationToken |
The organization token you wish to perform the search, will default to current organization if not provided. |
continuationToken |
Pass in a continuation token to paginate results. |
completionBlock |
Block which should handle the returned TTTag array. If no tags are found, returned array will be empty. The resultMetadata will contain some extra information about the search results such as the total number of possible results and pagniation data |
filterColorTokens |
An Array of Color tokens (NSString) you wish to filter by. |
Discussion
Returns an NSArray of TTTag objects which passes one of the following string comparisons:
- Its displayName property contains the search string. *
Declared In
TTKitClass.h
– roleWithToken:
Retrieve a role for the provided token.
- (TTRole *_Nullable)roleWithToken:(NSString *_Nonnull)token
Parameters
token |
A role token. |
---|
Return Value
A TTRole object with the provided token.
Declared In
TTKitClass.h
– optInToRole:success:failure:
Opt in local user to a role.
- (id _Nullable)optInToRole:(TTRole *_Nonnull)role success:(void ( ^ _Nullable ) ( TTRole *_Nullable role ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
role |
The role you wish to Opt in to. |
---|---|
success |
Success block with updated role. |
failure |
Failure block, provides an NSError with a description of the issue. |
Return Value
A TTRole object with the provided token.
Declared In
TTKitClass.h
– optOutOfRole:optInUser:success:failure:
Opt out local user to a role.
- (id _Nullable)optOutOfRole:(TTRole *_Nonnull)role optInUser:(TTUser *_Nullable)newUser success:(void ( ^ _Nullable ) ( TTRole *_Nullable role ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
role |
The role you wish to Opt out of. |
---|---|
newUser |
optional new user to opt in after the local user is remove from the role. |
success |
Success block with updated role. |
failure |
Failure block, provides an NSError with a description of the issue. |
Return Value
A TTRole object with the provided token.
Declared In
TTKitClass.h
– removeRoleFromGroup:group:success:failure:
Leave group as a role.
- (void)removeRoleFromGroup:(TTRole *_Nonnull)role group:(TTGroup *_Nonnull)group success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
role |
The role you wish to remove from the group. |
---|---|
group |
The group you wish to update. |
success |
Success block with updated role. |
failure |
Failure block, provides an NSError with a description of the issue. |
Declared In
TTKitClass.h
– tagsForOrganizationToken:success:failure:
Fetch/refresh the complete list of tags.
- (void)tagsForOrganizationToken:(NSString *_Nullable)organizationToken success:(void ( ^ _Nullable ) ( NSArray *_Nullable tags ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
organizationToken |
The organization token, will default to current organization token. |
---|---|
completion |
Called upon query’s completion. |
Declared In
TTKitClass.h
Handling Message Attachment
– isMimeTypeSupported:
Checks if the mime type is a supported type for attachments
- (BOOL)isMimeTypeSupported:(NSString *_Nonnull)type
Parameters
type |
mime type of the attachment |
---|
Return Value
A BOOL indicating if type is supported.
Declared In
TTKitClass.h
– fileExtensionForMimeType:
Get file extension string for a given mime type
- (NSString *_Nullable)fileExtensionForMimeType:(NSString *_Nonnull)type
Parameters
type |
MIME type of attachment |
---|
Return Value
corresponding file extension for attachment
Declared In
TTKitClass.h
– queueMessageForAttachmentDownload:
Queue a message attachment for download.
- (void)queueMessageForAttachmentDownload:(TTMessage *_Nonnull)message
Parameters
message |
message with attachment object. |
---|
Discussion
If the message attachment object is empty or exists on disk the download will be aborted.
Declared In
TTKitClass.h
– queueMessageForAttachmentDownload:observer:
Queue a message attachment for download.
- (void)queueMessageForAttachmentDownload:(TTMessage *_Nonnull)message observer:(id<TTAttachmentDownloadObserver> _Nullable)observer
Parameters
message |
message with attachment object. |
---|---|
observer |
an TTAttachmentDownloadObserver to observe progress/state of the attachment download. |
Discussion
If the message attachment object is empty or exists on disk the download will be aborted.
Declared In
TTKitClass.h
– removeAttachmentObserver:forMessage:
Remove an observer from the list of observers for message attachment download.
- (void)removeAttachmentObserver:(id<TTAttachmentDownloadObserver> _Nonnull)observer forMessage:(TTMessage *_Nonnull)message
Parameters
observer |
an TTAttachmentDownloadObserver to observe progress/state of the attachment download. |
---|---|
message |
message with attachment object. |
Declared In
TTKitClass.h
– isMessageAttachmentCachedToDisk:
Checks if the message attachment exists on disk.
- (BOOL)isMessageAttachmentCachedToDisk:(TTMessage *_Nonnull)message
Parameters
message |
message with attachment object. |
---|
Return Value
A BOOL if the attachment exists on disk.
Discussion
If the message attachment object is nil returns false.
Declared In
TTKitClass.h
– isMessageAttachmentCachedToSharedFolder:
Checks if the message attachment exists on disk in the share folder (App group).
- (BOOL)isMessageAttachmentCachedToSharedFolder:(TTMessage *_Nonnull)message
Parameters
message |
message with attachment object. |
---|
Return Value
A BOOL if the attachment exists on disk.
Discussion
If the message attachment object is nil returns false.
Declared In
TTKitClass.h
– localPathForAttachment:
File path string to the attachment on disk.
- (NSString *_Nullable)localPathForAttachment:(TTMessage *_Nonnull)message
Parameters
message |
message with attachment object. |
---|
Return Value
An ‘NSString’ Object.
Discussion
If the message attachment object is nil returns nil.
Declared In
TTKitClass.h
Attachments Upload and Download data
– getDownloadDataForMessage:
DownloadData contains progress information regarding an attachment download
- (TTDownloadData *_Nullable)getDownloadDataForMessage:(TTMessage *_Nonnull)message
Parameters
message |
message with attachment object. |
---|
Return Value
An ‘TTDownloadData’ Object.
Declared In
TTKitClass.h
– getUploadDataForMessage:
UploadData contains progress information regarding an attachment upload
- (TTUploadData *_Nullable)getUploadDataForMessage:(TTMessage *_Nonnull)message
Parameters
message |
message object. |
---|
Return Value
An ‘TTUploadData’ Object.
Declared In
TTKitClass.h
– encryptData:
Encrypt an NSData object.
- (NSData *_Nullable)encryptData:(NSData *_Nonnull)data
Parameters
data |
NSData object to be encrypted. |
---|
Return Value
An Encrypted NSData object if input parameters were valid and encryption was successful, nil otherwise.
Declared In
TTKitClass.h
– decryptData:
Decrypt an encrypted NSData object.
- (NSData *_Nullable)decryptData:(NSData *_Nonnull)data
Parameters
data |
Encrypted NSData object to be decrypted. |
---|
Return Value
A Decrypted NSData object if input parameters were valid and decryption was successful, nil otherwise.
Declared In
TTKitClass.h
– removeCacheDataForKey:
Remove cached data using the provided key.
- (void)removeCacheDataForKey:(NSString *_Nonnull)key
Parameters
key |
Key for the cached value (NSString). |
---|
Declared In
TTKitClass.h
– encryptDataAndCache:key:
Encrypt NSData and cache to both disk and memory using the provided key.
- (void)encryptDataAndCache:(NSData *_Nonnull)data key:(NSString *_Nonnull)key
Parameters
data |
NSData to be encrypted. |
---|---|
key |
Key for the cached value (NSString). |
Declared In
TTKitClass.h
– localPathForMessageWithToken:conversationHash:
Retrieve message attachment file path, use the localToken for message you’ve sent and token for messages recieved.
- (NSString *_Nullable)localPathForMessageWithToken:(NSString *_Nonnull)token conversationHash:(NSString *_Nonnull)conversationHash
Parameters
token |
Either the message localToken or token. |
---|---|
conversationHash |
message conversationHash. |
Return Value
File path to the message attachment.
Declared In
TTKitClass.h
– getDecryptedCachedDataForKey:
Retrieve decrypted cached object, which was stored using the provided key.
- (NSData *_Nullable)getDecryptedCachedDataForKey:(NSString *_Nonnull)key
Parameters
key |
Key for the cached value (NSString). |
---|
Return Value
Decrypted NSData object.
Discussion
Method will first search the in-memory cache. If no object fits the provided key, Disk cache will be searched afterwards.
Declared In
TTKitClass.h
– encryptDataAndCacheToMemory:key:
Encrypt NSData and cache to memory using the provided key.
- (void)encryptDataAndCacheToMemory:(NSData *_Nonnull)data key:(NSString *_Nonnull)key
Parameters
data |
NSData to be encrypted. |
---|---|
key |
Key for the cached value (NSString). |
Declared In
TTKitClass.h
– encryptDataAndCacheToDisk:key:
Encrypt NSData and cache to disk using the provided key.
- (void)encryptDataAndCacheToDisk:(NSData *_Nonnull)data key:(NSString *_Nonnull)key
Parameters
data |
NSData to be encrypted. |
---|---|
key |
Key for the cached value (NSString). |
Declared In
TTKitClass.h
– objectFromMemoryCache:
Retrieve a cached object by its key from the in-memory cache.
- (NSData *_Nullable)objectFromMemoryCache:(NSString *_Nonnull)key
Parameters
key |
Key for the cached value (NSString). |
---|
Return Value
Decrypted NSData object for the provided key , nil if no object exists in in-memory cache for provided key.
Declared In
TTKitClass.h
– objectFromDiskCache:
Retrieve a cached object by its key from the disk cache.
- (NSData *_Nullable)objectFromDiskCache:(NSString *_Nonnull)key
Parameters
key |
Key for the cached value (NSString). |
---|
Return Value
Decrypted NSData object for the provided key , nil if no object exists in disk cache for provided key.
Declared In
TTKitClass.h
– dataForAttachment:
Retrieve a decrypted NSData object representing the TTMessage’s attachment.
- (NSData *_Nullable)dataForAttachment:(TTMessage *_Nonnull)message
Parameters
message |
A TTMessage with an attachment. |
---|
Return Value
Decrypted NSData object or nil if no attachment exists.
Declared In
TTKitClass.h
Unread Counts
– badgeDataForRosterEntry:
Retrieve TTBadgeData object for a provided TTRosterEntry.
- (TTBadgeData *_Nullable)badgeDataForRosterEntry:(TTRosterEntry *_Nonnull)rosterEntry
Parameters
rosterEntry |
A TTRosterEntry object. |
---|
Return Value
A TTBadgeData object with the same conversation hash as the provided TTRosterEntry.
Declared In
TTKitClass.h
– badgeDataForConversationHash:
Retrieve TTBadgeData object for a provided conversation hash.
- (TTBadgeData *_Nullable)badgeDataForConversationHash:(NSString *_Nonnull)conversationHash
Parameters
conversationHash |
Conversation hash (NSString). |
---|
Return Value
A TTBadgeData object with the provided conversation hash.
Declared In
TTKitClass.h
– badgeDataForOrganization:
Retrieve TTBadgeData object for all conversations of a provided TTOrganization.
- (TTBadgeData *_Nullable)badgeDataForOrganization:(TTOrganization *_Nonnull)organization
Parameters
organization |
A TTOrganization object. |
---|
Return Value
A TTBadgeData object containing unread count for all conversations of a provided TTOrganization.
Declared In
TTKitClass.h
– badgeDataForAllOrganizations
Retrieve all TTBadgeData objects for all organizations.
- (NSArray *_Nullable)badgeDataForAllOrganizations
Return Value
An NSArray of TTBadgeData objects containing unread count for all conversations of a provided TTOrganization.
Declared In
TTKitClass.h
– badgeDataForOrganizationToken:
Retrieve TTBadgeData object for all conversations of a provided organization token.
- (TTBadgeData *_Nullable)badgeDataForOrganizationToken:(NSString *_Nonnull)orgToken
Parameters
orgToken |
An organization’s token (NSString). |
---|
Return Value
A TTBadgeData object containing unread count for all conversations of the provided orgToken.
Declared In
TTKitClass.h
– getTotalUnreadMessageCount
Total unread messages count for the local user across organizations.
- (NSUInteger)getTotalUnreadMessageCount
Return Value
Count of all unread messages (NSUInteger).
Declared In
TTKitClass.h
– totalNumberOfConversationsWithUnreadMessages
Total number of conversations with at least one unread message across all organizations.
- (NSUInteger)totalNumberOfConversationsWithUnreadMessages
Return Value
Count of conversations with unread messages (NSUInteger).
Declared In
TTKitClass.h
Local Address Book
– contactForHashId:
Retrieve TTContact with contact hashId
- (TTContact *_Nullable)contactForHashId:(NSString *_Nonnull)hashId
Return Value
A ‘TTContact’ object
Declared In
TTKitClass.h
– loadLocalContacts
Local contacts from device AddressBook.
- (void)loadLocalContacts
Discussion
All contacts are saved and fetched from TTKit dedicated Contacts Database, this method will fetch the address book contacts from the device and update TTKit local contacts database.
Declared In
TTKitClass.h
– localContactsFetchControllerWithDelegate:
Local address book Contacts fetchController will return all TTcontact objects sorted by name.
- (NSFetchedResultsController *_Nullable)localContactsFetchControllerWithDelegate:(id _Nullable)delegate
Parameters
delegate |
NSFetchedResultsControllerDelegate. |
---|
Return Value
An ‘NSFetchedResultsController’ Object.
Discussion
Warning: Must be called on the main thread only.
Declared In
TTKitClass.h
– searchLocalContactsWithString:success:
Search the device’s local contacts using the provided value.
- (void)searchLocalContactsWithString:(NSString *_Nonnull)search success:(void ( ^ _Nullable ) ( NSArray *_Nullable contacts ))completionBlock
Parameters
search |
Search string to be used (NSString). |
---|---|
completionBlock |
Called upon query’s completion. The contacts NSArray contains the resulting TTContact objects, and will be empty if query had no results. |
Discussion
Returns an NSArray of TTContact objects which passes one of the following string comparisons:
- Its full names contains the search string. Case and diacritic insensitive.
- Its email contains the search string. Case and diacritic insensitive.
- Its phone number contains the search string. Case and diacritic insensitive.
- Its initials contains the search string. Case insensitive and diacritic sensitive.
Declared In
TTKitClass.h
Misc
– setIsTyping:success:failure:
Use this method when local user starts typing a message to another user.
- (void)setIsTyping:(NSString *_Nonnull)receipentToken success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
receipentToken |
User token of recepient. |
---|---|
success |
Success block. |
failure |
Failure block. |
Declared In
TTKitClass.h
– didEndTyping:success:failure:
Use this method when local user finished typing a message to another user.
- (void)didEndTyping:(NSString *_Nonnull)receipentToken success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
receipentToken |
User token of recepient. |
---|---|
success |
Success block. |
failure |
Failure block. |
Declared In
TTKitClass.h
– getProxyPhoneNumberForUserWithToken:organizationToken:success:failure:
Gets a phone number from the server that can be dialed to reach another user.
- (id _Nullable)getProxyPhoneNumberForUserWithToken:(NSString *_Nonnull)userToken organizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( NSString *_Nullable proxyPhone ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
success |
Called when we successfully get a proxy phone number from the server |
---|---|
failure |
Called when the server returns an error or cannot be reached. |
userID |
The userID for the user you’d like to reach |
Declared In
TTKitClass.h
– isClickToCallEnabledForOrganizationWithToken:
Check if click-to-call is enabled for an organization
- (BOOL)isClickToCallEnabledForOrganizationWithToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
A token corresponding to the organization you’d like to check for the click-to-call feature. |
---|
Declared In
TTKitClass.h
Do Not Disturb Settings
– setDoNotDisturb:
Use this method to update your user’s dnd setting.
- (void)setDoNotDisturb:(BOOL)dnd
Parameters
dnd |
do not disturb value, set to YES to turn dnd on. |
---|
Declared In
TTKitClass.h
– doNotDisturb
Use this method to get user’s dnd value.
- (BOOL)doNotDisturb
Declared In
TTKitClass.h
– isRoleServiceEnabledForOrganization:
Use this method to check if role service is enabled for any Organization.
- (BOOL)isRoleServiceEnabledForOrganization:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
The organization token for which to check for role service feature. |
---|
Declared In
TTKitClass.h
– setDoNotDisturbAutoReply:
Use this method to update your user’s dnd auto reply response.
- (void)setDoNotDisturbAutoReply:(NSString *_Nonnull)autoReply
Parameters
autoReplyResponse |
auto reply message that will be sent when the user is on dnd. If not set, the reply message will default to ‘Do not disturb’ |
---|
Declared In
TTKitClass.h
Auto-Forwrard Settings
– isAutoforwardOnforCurrentOrganization
Use this method to get user’s autoforward value for Organization currently used.
- (BOOL)isAutoforwardOnforCurrentOrganization
Declared In
TTKitClass.h
– autoforwardRecipientForCurrentOrganization
Use this method to get user’s autoforward recipient setting for current Organization.
- (TTUser *_Nullable)autoforwardRecipientForCurrentOrganization
Declared In
TTKitClass.h
– autoforwardEnabledForOrganizationToken:
Use this method to check if autoforwarding is enabled for the current org.
- (BOOL)autoforwardEnabledForOrganizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
The organization token for which to check for auto-forward feature. |
---|
Declared In
TTKitClass.h
– setAutoforwardRecipientToken:organizationToken:
Use this method to update your user’s autoforwardRecipientToken.
- (void)setAutoforwardRecipientToken:(NSString *_Nonnull)recipientToken organizationToken:(NSString *_Nonnull)organizationToken
Parameters
recipientToken |
User Token for auto-forward message recipient. |
---|---|
organizationToken |
The organization token for which to configure auto-forward receipient. |
Declared In
TTKitClass.h
– unsetAutoforwardForOrganizationToken:success:failure:
Use this method to turn off autoforwarding for the current user.
- (void)unsetAutoforwardForOrganizationToken:(NSString *_Nonnull)organizationToken success:(void ( ^ _Nullable ) ( void ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
organizationToken |
The organization token for which to unset auto-forward recipient. |
---|---|
success |
Success block. |
failure |
Failure block. |
Declared In
TTKitClass.h
– autoforwardReceiverTokenForOrganizationToken:
Use this method to get user’s autoforward receiver Token.
- (NSString *_Nullable)autoforwardReceiverTokenForOrganizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
The organization token for which to unset auto-forwarding. |
---|
Declared In
TTKitClass.h
– autoforwardSetterTokensForOrganizationToken:
Use this method to get user’s autoforwarding Setters (token).
- (NSArray *_Nullable)autoforwardSetterTokensForOrganizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
The organization token for which to unset auto-forwarding. |
---|
Declared In
TTKitClass.h
– downloadAutoforwardFinalRecipientForRosterEntry:completion:
Use this method to get autoforwarding final recipient for a Roster Entry. The method is asynchronous, but will will fire the completion block very quickly in the event that a network request isn’t needed.
- (void)downloadAutoforwardFinalRecipientForRosterEntry:(TTRosterEntry *_Nonnull)rosterEntry completion:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))completion
Parameters
rosterEntry |
The roster entry from which to resolve the final recipient. |
---|
Declared In
TTKitClass.h
– downloadAutoforwardFinalRecipientForUser:organizationToken:completion:
Use this method to get user’s autoforwarding final recipient. The method is asynchronous, but will will fire the completion block very quickly in the event that a network request isn’t needed.
- (void)downloadAutoforwardFinalRecipientForUser:(TTUser *_Nonnull)user organizationToken:(NSString *_Nonnull)organizationToken completion:(void ( ^ _Nullable ) ( TTUser *_Nullable user ))completion
Parameters
organizationToken |
The organization token for which to unset auto-forwarding. |
---|
Declared In
TTKitClass.h
– userTitleForOrganizationToken:
User’s title, i.e ‘Chief Operations Officer’ for a given organization
- (NSString *_Nullable)userTitleForOrganizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
Organization token. |
---|
Declared In
TTKitClass.h
– setUserTitle:organizationToken:
Set User’s title for a given organization
- (void)setUserTitle:(NSString *_Nonnull)title organizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
Organization token. |
---|---|
userTitle |
User title. |
Declared In
TTKitClass.h
– userDepartmentForOrganizationToken:
User’s department, i.e ‘Marketing’ for a given organization
- (NSString *_Nullable)userDepartmentForOrganizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
Organization token. |
---|
Declared In
TTKitClass.h
– setUserDepartment:organizationToken:
Set User’s department for a given organization
- (void)setUserDepartment:(NSString *_Nonnull)department organizationToken:(NSString *_Nonnull)organizationToken
Parameters
organizationToken |
Organization token. |
---|---|
userTitle |
User title. |
Declared In
TTKitClass.h
– refreshMessageStatusWithMessageToken:success:failure:
Refresh the message TTMessageStatus set
- (id _Nullable)refreshMessageStatusWithMessageToken:(NSString *_Nonnull)messageToken success:(void ( ^ _Nullable ) ( TTMessage *_Nullable message ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure
Parameters
messageToken |
Message Token. |
---|---|
success |
Success block. |
failure |
Failure block. |
Declared In
TTKitClass.h
Mute
– muteEntity:organizationToken:forMinutes:withCompletionHandler:
Mutes conversation for a set amount of time.
- (id _Nullable)muteEntity:(NSManagedObject *_Nonnull)entity organizationToken:(NSString *_Nonnull)organizationToken forMinutes:(NSUInteger)minutes withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable error ))completionHandler
Parameters
entity |
The target of the conversation that is being muted. |
---|---|
organizationToken |
The organization token for the conversation. |
minutes |
The amount of time in minutes to mute the conversation. |
completionHandler |
Completion block invoked when muting call is complete, passing back any errors that occurred. |
Declared In
TTKitClass.h
– unmuteEntity:organizationToken:withCompletionHandler:
Unmutes conversation.
- (id _Nullable)unmuteEntity:(NSManagedObject *_Nonnull)entity organizationToken:(NSString *_Nonnull)organizationToken withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable error ))completionHandler
Parameters
entity |
The target of the conversation that is being unmuted. |
---|---|
organizationToken |
The organization token for the conversation. |
completionHandler |
Block that is invoked when the unmuting call is complete, passing back any errors that occurred. |
Declared In
TTKitClass.h