MXClient Class Reference

Inherits from NSObject
Declared in MXClient.h

Other Methods

  delegate

@property delegate

@property (nonatomic, readwrite, weak) id<MXClientChatDelegate> _Nullable delegate

Discussion

The delegate for notifying the calling application during the chat/meet

Declared In

MXClient.h

– initializeUserAccount:orgID:firstName:lastName:avatar:devicePushNotificationToken:withTimeout:success:failure:

Setup user information. It need OAuth login with Moxtra Account. The 3rd party should not call any other APIs except clientWithApplicationClientID before initializeUserAccount success block call back.

- (void)initializeUserAccount:(MXUserIdentity *)userIdentity orgID:(NSString *)orgID firstName:(NSString *)firstName lastName:(NSString *)lastName avatar:(UIImage *)avatar devicePushNotificationToken:(NSData *)deviceToken withTimeout:(NSTimeInterval)timeout success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *error ))failure

Discussion

@param userIdentity The user identity. @param orgID The user org identity. @param firstName User’s firstName. @param lastName User’s lastName. @param avatar User’s avatar image. If need we will resize it according to the image size. @param devicePushNotificationToken The device push notification token if the 3rd paryt need support notification for Moxtra client. @param withTimeout The timeout when initialize user account, the default timeout will be set if the value is 0.0. @param success Callback interface for notifying the calling application when setup user successed. @param failure Callback interface for notifying the calling application when setup user failed.

Declared In

MXClient.h

– unlinkAccount:

Unlink Moxtra account.

- (void)unlinkAccount:(void ( ^ ) ( BOOL success ))completion

Declared In

MXClient.h

– updateUserProfile:lastName:avatar:success:failure:

If user need update their profile, you can call this API to update them.

- (void)updateUserProfile:(nullable NSString *)firstName lastName:(nullable NSString *)lastName avatar:(nullable UIImage *)avatar success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param firstName User’s firstName. @param lastName User’s lastName. @param avatar User’s avatar image. If need we will resize it according to the image size. @param success Callback interface for notifying the calling application when update user’s profile successed. @param failure Callback interface for notifying the calling application when update user’s profile failed.

Declared In

MXClient.h

– isUserLoggedIn

User login status.

- (BOOL)isUserLoggedIn

Declared In

MXClient.h

– getUserInfo

Get user info.

- (nullable MXChatMemberInfo *)getUserInfo

Declared In

MXClient.h

– markAsRead:

Clear binder’s unread feeds' count.

- (void)markAsRead:(NSString *_Nonnull)binderID

Declared In

MXClient.h

– getSDKVersion

Get sdk version.

- (nonnull NSString *)getSDKVersion

Declared In

MXClient.h

Meet Methods

– startMeet:inviteAttendeesUniqueID:success:failure:

Start a online meeting.

- (void)startMeet:(NSString *_Nullable)topic inviteAttendeesUniqueID:(NSArray *_Nullable)uniqueIDArray success:(void ( ^ _Nullable ) ( NSString *_Nullable meetID ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param topic The meet topic. @param uniqueIDArray The user’s unique ID array that you want to invite to join. @param success Callback interface for notifying the calling application when the meet has started. @param failure Callback interface for notifying the calling application when the meet start failed.

Declared In

MXClient+Meet.h

– startMeet:inviteAttendeesOrgUniqueIDs:success:failure:

Start a online meeting. Support cross the organization invitation.

- (void)startMeet:(NSString *_Nullable)topic inviteAttendeesOrgUniqueIDs:(NSDictionary *_Nullable)orgUniqueIDs success:(void ( ^ _Nullable ) ( NSString *_Nullable meetID ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param topic The meet topic. @param inviteAttendeesOrgUniqueIDs The key is org ID, and the value is user’s unique ID array. @param success Callback interface for notifying the calling application when the meet has started. @param failure Callback interface for notifying the calling application when the meet start failed.

Declared In

MXClient+Meet.h

– joinMeet:withUserName:success:failure:

Join the online meeting.

- (void)joinMeet:(NSString *_Nonnull)meetID withUserName:(NSString *_Nullable)userName success:(void ( ^ _Nullable ) ( NSString *_Nullable meetID ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param meetID The meet ID. @param userName The user name in meet in the case user is not logged firstly. The default name will be setted if the value is nil. @param success Callback interface for notifying the calling application when the user has joined the meet. @param failure Callback interface for notifying the calling application when the user join meet failed.

Declared In

MXClient+Meet.h

– inviteMeetAttendees:success:failure:

Invite attendees to join meet.

- (void)inviteMeetAttendees:(NSArray *_Nonnull)uniqueIDArray success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param uniqueIDArray The user’s unique ID array. @param success Callback interface for notifying the calling application when invite attendees successed. @param failure Callback interface for notifying the calling application when invite attendees failed.

Declared In

MXClient+Meet.h

– inviteToMeet:success:failure:

Invite attendees to join meet. Support cross the organization invitation.

- (void)inviteToMeet:(NSDictionary *_Nonnull)orgUniqueIDs success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param orgUniqueIDs The key is org ID, and the value is user’s unique ID array. @param success Callback interface for notifying the calling application when invite attendees successed. @param failure Callback interface for notifying the calling application when invite attendees failed.

Declared In

MXClient+Meet.h

– getMeetMembers

Get meet members. Return members' MXMeetMemberInfo array. Return nil if no meeting is going on.

- (nullable NSArray *)getMeetMembers

Declared In

MXClient+Meet.h

– startScheduledMeet:success:failure:

Start a scheduled meeting.

- (void)startScheduledMeet:(NSString *_Nonnull)meetID success:(void ( ^ _Nullable ) ( NSString *_Nullable meetID ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param meetID The meet ID. @param success Callback interface for notifying the calling application when the meet has started. @param failure Callback interface for notifying the calling application when the meet start failed.

Declared In

MXClient+Meet.h

– joinScheduledMeet:success:failure:

Join a scheduled meeting.

- (void)joinScheduledMeet:(NSString *_Nonnull)meetID success:(void ( ^ _Nullable ) ( NSString *_Nullable meetID ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param meetID The meet ID. @param success Callback interface for notifying the calling application when the meet has started. @param failure Callback interface for notifying the calling application when the meet start failed.

Declared In

MXClient+Meet.h

– acceptScheduledMeet:

Accept a scheduled meeting.

- (void)acceptScheduledMeet:(NSString *_Nonnull)meetID

Discussion

@param meetID The meet ID.

Declared In

MXClient+Meet.h

– rejectScheduledMeet:

Reject a scheduled meeting.

- (void)rejectScheduledMeet:(NSString *_Nonnull)meetID

Discussion

@param meetID The meet ID.

Declared In

MXClient+Meet.h

– setMeetColorStyle:

Set meet color styles.

- (void)setMeetColorStyle:(NSDictionary *_Nonnull)meetColorStyles

Discussion

@param meetColorStyles The meet color styles. The possible keys and values for the meet color styles are well documented. Some possible keys are: - kMXMeetStyleViewBackgroundColor - kMXMeetStyleTopToolbarBackgroundColor - kMXMeetStyleBottomToolbarBackgroundColor - kMXMeetStyleLeaveEndTextColor - kMXMeetStyleHighlightColor The values are UIColor objects.

Declared In

MXClient+Meet.h

– stopMeet

End or leave the online meeting.

- (void)stopMeet

Declared In

MXClient+Meet.h

Notification Methods

– updateRemoteNotificationsWithDeviceToken:

3rd party notification support

- (void)updateRemoteNotificationsWithDeviceToken:(NSData *_Nullable)deviceToken

Discussion

Update device push notification token if the 3rd paryt need support remote notification for Moxtra client. You should call this API in UIApplicationDelegate - (void)application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken

Declared In

MXClient+Notification.h

– isMoxtraRemoteNotification:

Reture YES if the remote notification is from Moxtra.

- (BOOL)isMoxtraRemoteNotification:(NSDictionary *_Nullable)userInfo

Declared In

MXClient+Notification.h

– receiveRemoteNotificationWithUserInfo:

Handle the remote notification if the 3rd paryt need support remote notification for Moxtra client. Reture binder id or meet id if Moxtra client need handle the remote notification. You should call this API in UIApplicationDelegate - (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo

- (nullable NSString *)receiveRemoteNotificationWithUserInfo:(NSDictionary *_Nullable)userInfo

Declared In

MXClient+Notification.h

– receiveRemoteNotificationWithUserInfo:fetchCompletionHandler:

Handle the remote notification if the 3rd paryt need support remote notification for Moxtra client. Reture binder id or meet id if Moxtra client need handle the remote notification. You should call this API in UIApplicationDelegate - (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler

- (nullable NSString *)receiveRemoteNotificationWithUserInfo:(NSDictionary *_Nullable)userInfo fetchCompletionHandler:(void ( ^ _Nullable ) ( UIBackgroundFetchResult result ))completionHandler

Declared In

MXClient+Notification.h

– setBadgeNumberDidEnterBackground:

You should call this API to set the app badge number with the 3rd party’s badge number in UIApplicationDelegate - (void)applicationDidEnterBackground:(UIApplication *)application We will set app badge number in this API (3rd party’s badge number + Moxtra’s badge number)

- (void)setBadgeNumberDidEnterBackground:(NSInteger)thirdPartyBadgeNumber

Declared In

MXClient+Notification.h

Chat Methods

– getChatSessionArray

Get chat array. The object in the array is MXChatSession.

- (nullable NSArray *)getChatSessionArray

Declared In

MXClient+Chat.h

– createChat:inviteMembersUniqueID:success:failure:

Create a new group chat.

- (void)createChat:(nullable NSString *)topic inviteMembersUniqueID:(nullable NSArray *)uniqueIDArray success:(void ( ^ _Nullable ) ( NSString *_Nullable binderID , UIViewController *_Nullable chatViewController ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param topic The topic of the group chat. The default topic is made up of the chat members' name. @param uniqueIDArray The user’s unique ID array that you want to invite to join. @param success Callback interface for notifying the calling application when create a group chat successed. @param failure Callback interface for notifying the calling application when create a group chat failed.

Declared In

MXClient+Chat.h

– createChat:inviteMembersOrgUniqueIDs:success:failure:

Create a new group chat. Support cross the organization invitation.

- (void)createChat:(nullable NSString *)topic inviteMembersOrgUniqueIDs:(nullable NSDictionary *)orgUniqueIDs success:(void ( ^ _Nullable ) ( NSString *_Nullable binderID , UIViewController *_Nullable chatViewController ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param topic The topic of the group chat. The default topic is made up of the chat members' name. @param orgUniqueIDs The key is org ID, and the value is user’s unique ID array. @param success Callback interface for notifying the calling application when create a group chat successed. @param failure Callback interface for notifying the calling application when create a group chat failed.

Declared In

MXClient+Chat.h

– createIndividualChat:success:failure:

Create a new individual chat or return an exist individual chat.

- (void)createIndividualChat:(nonnull NSString *)peerUniqueID success:(void ( ^ _Nullable ) ( NSString *_Nullable binderID , UIViewController *_Nullable chatViewController ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param peerUniqueID The peer’s unique ID. @param success Callback interface for notifying the calling application when create a individual chat successed or there is an exist individual chat. @param failure Callback interface for notifying the calling application when create a individual chat failed.

Declared In

MXClient+Chat.h

– createIndividualChat:peerOrgID:success:failure:

Create a new individual chat or return an exist individual chat. Support cross the organization invitation.

- (void)createIndividualChat:(nonnull NSString *)peerUniqueID peerOrgID:(nonnull NSString *)peerOrgID success:(void ( ^ _Nullable ) ( NSString *_Nullable binderID , UIViewController *_Nullable chatViewController ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param peerUniqueID The peer’s unique ID. @param peerOrgID The peer’s org ID. @param success Callback interface for notifying the calling application when create a individual chat successed or there is an exist individual chat. @param failure Callback interface for notifying the calling application when create a individual chat failed.

Declared In

MXClient+Chat.h

– isIndividualChat:

Return YES if it is individual chat.

- (BOOL)isIndividualChat:(NSString *_Nonnull)binderID

Discussion

@param binderID The binder id that identify the chat.

Declared In

MXClient+Chat.h

– deleteChat:success:failure:

Delete a chat.

- (void)deleteChat:(NSString *_Nonnull)binderID success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param binderID The binder id that identify the chat. @param success Callback interface for notifying the calling application when delete chat successed. @param failure Callback interface for notifying the calling application when delete chat failed.

Declared In

MXClient+Chat.h

– getChatViewController:success:failure:

Get a chat/files/todo/meet container view controller via binder id and return it.

- (void)getChatViewController:(NSString *_Nonnull)binderID success:(void ( ^ _Nullable ) ( UIViewController *_Nullable chatViewController ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param binderID The binder id that identify the chat. @param success Callback interface for notifying the calling application when get a chat/files/todo/meet container view controller successed. @param failure Callback interface for notifying the calling application when get a chat/files/todo/meet container view controller failed.

Declared In

MXClient+Chat.h

– inviteChatMembers:binderID:success:failure:

Invite members to join chat.

- (void)inviteChatMembers:(NSArray *_Nonnull)uniqueIDArray binderID:(NSString *_Nonnull)binderID success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param uniqueIDArray The user’s unique ID array. @param binderID The binder id of the chat that you want to invite members to join. @param success Callback interface for notifying the calling application when invite members successed. @param failure Callback interface for notifying the calling application when invite members failed.

Declared In

MXClient+Chat.h

– inviteToChat:binderID:success:failure:

Invite members to join chat. Support cross the organization invitation.

- (void)inviteToChat:(NSDictionary *_Nonnull)orgUniqueIDs binderID:(NSString *_Nonnull)binderID success:(void ( ^ _Nullable ) ( ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param orgUniqueIDs The key is org ID, and the value is user’s unique ID array. @param binderID The binder id of the chat that you want to invite members to join. @param success Callback interface for notifying the calling application when invite members successed. @param failure Callback interface for notifying the calling application when invite members failed.

Declared In

MXClient+Chat.h

– getChatMembers:success:failure:

Get chat members via binder ID. Return members' MXChatMemberInfo array.

- (void)getChatMembers:(NSString *_Nonnull)binderID success:(void ( ^ _Nullable ) ( NSArray *_Nullable chatMembers ))success failure:(void ( ^ _Nullable ) ( NSError *_Nullable error ))failure

Discussion

@param binderID The binder id that identify the chat.

Declared In

MXClient+Chat.h

– setTags:binderID:success:failure:

Set tags to chat.

- (void)setTags:(NSDictionary *)tags binderID:(NSString *)binderID success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *error ))failure

Discussion

@param tags The tags that you need set to the chat. @param binderID The binder id that identify the chat. @param success Callback interface for notifying the calling application when set tags successed. @param failure Callback interface for notifying the calling application when set tags failed.

Declared In

MXClient+Chat.h

– importFilesWithFilePathArray:

Import files to current chat. 3rd party can call this API in the delegate method presentAddFilesViewController or presentMoreFilesViewController.

- (void)importFilesWithFilePathArray:(NSArray *_Nonnull)filePathArray

Declared In

MXClient+Chat.h