MXChatClient Class Reference

Inherits from NSObject
Declared in MXChatClient.h

Overview

The MXChatClient class provides interfaces for user authentication. A MXChatClient object maintains the linked user profile represented by a MXUserItem object as well as configuration objects that define chat and meet session behaviours.

  chatSessionConfig

A configuration object for all chat sessions.

@property (nonatomic, strong, readonly) MXChatConfig *chatSessionConfig

Declared In

MXChatClient.h

  meetSessionConfig

A configuration object for all meet sessions.

@property (nonatomic, strong, readonly) MXMeetConfig *meetSessionConfig

Declared In

MXChatClient.h

  currentUser

A user item object representing the linked user.

@property (nonatomic, strong, readonly, nullable) MXUserItem *currentUser

Declared In

MXChatClient.h

  delegate

The object that acts as the delegate of the chat client

@property (nonatomic, weak, nullable) id<MXChatClientDelegate> delegate

Declared In

MXChatClient.h

+ sharedInstance

Get chat client singleton

+ (instancetype)sharedInstance

Declared In

MXChatClient.h

+ version

Get SDK version.

+ (nonnull NSString *)version

Declared In

MXChatClient.h

– linkWithAccessToken:baseDomain:completionHandler:

Link with access token. It need OAuth login with Moxtra Account.

- (void)linkWithAccessToken:(NSString *)token baseDomain:(NSString *)baseDomain completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

token

Access token used for authentication

baseDomain

The server domain url. There are 2 basedomains you might to use: “www.moxtra.com” for production environment, “sandbox.moxtra.com” for sanbox environment During development, you will point your app at Moxtra’s “sandbox” development environment. Set the base domain to ‘production’ when pointing your app to production environment.

completionHandler

A block object to be executed when the action completes

Declared In

MXChatClient.h

– linkWithUniqueId:orgId:clientId:clientSecret:baseDomain:completionHandler:

Link with a unique identifier then call a handler upon completion. It need simple SSO login.

- (void)linkWithUniqueId:(NSString *)uniqueId orgId:(NSString *_Nullable)orgId clientId:(NSString *)clientId clientSecret:(NSString *)clientSecret baseDomain:(NSString *)baseDomain completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

uniqueId

Unique ID

orgId

Organization ID. Set nil if there is no organization

clientId

Client ID of your app

clientSecret

Client secret of your app

baseDomain

The server domain url. There are 2 basedomains you might to use: “www.moxtra.com” for production environment, “sandbox.moxtra.com” for sanbox environment During development, you will point your app at Moxtra’s “sandbox” development environment. Set the base domain to ‘production’ when pointing your app to production environment.

completionHandler

A block object to be executed when the action completes

Declared In

MXChatClient.h

– unlink

Unlink current account.

- (void)unlink

Declared In

MXChatClient.h

– updateCurrentUserProfileWithFirstname:lastname:completionHandler:

Update the current user’s firstname and lastname.

- (void)updateCurrentUserProfileWithFirstname:(nullable NSString *)firstname lastname:(nullable NSString *)lastname completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

firstname

The firstname to set. Set nil if you don’t want to update firstname.

lastname

The lastname to set. Set nil if you don’t want to update lastname.

completionHandler

A block object to be executed when the action completes.

Declared In

MXChatClient.h

– updateCurrentUserProfileAvatar:withCompletionHandler:

Update the current user’s avatar.

- (void)updateCurrentUserProfileAvatar:(UIImage *)avatar withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

avatar

An image object that is going to be set as the current user’s avatar.

completionHandler

A block object to be executed when the action completes.

Declared In

MXChatClient.h

– registerNotificationDeviceToken:

Tells the Chat SDK that Apple Push Services successfully completes the registration process.

- (void)registerNotificationDeviceToken:(NSData *)token

Parameters

token

A token that identifies the device to Apple Push Notification Service (APNS)

Declared In

MXChatClient.h

– isMoxtraRemoteNotification:

Return a boolean value that indicates whether the specified notification is a remote notification from Moxtra

- (BOOL)isMoxtraRemoteNotification:(NSDictionary *)userInfo

Parameters

userInfo

The notification dictionary

Return Value

YES if it is a remote notification from Moxtra, otherwise NO.

Declared In

MXChatClient.h

– fetchItemWithRemoteNotification:completionHandler:

Parse a specified remote notification to get the related item.

- (void)fetchItemWithRemoteNotification:(NSDictionary *)userInfo completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , id _Nullable item ))completionHandler

Parameters

userInfo

The notification dictionary.

completionHandler

A block object to be executed when the action completes.

Discussion

The item parameter passed to completionHandler can be an instance of MXChat, MXMeet, MXCallItem or nil.

Declared In

MXChatClient.h