Moxtra iOS Meet SDK

This quick start guide provides the steps for you to get started quickly with the Moxtra iOS SDK for Chat. The Moxtra Chat module gives you access to a rich messaging service for one on one, group, or topic based conversations.

Start Meet

Start meet method to screen share, voice call and chat

- (void)startMeet:(NSString*)topic
            withDelegate:(id<MXClientMeetDelegate>)delegate
    inviteAttendeesBlock:(void(^)(NSString*meetID))inviteAttendeesBlock
                 success:(void(^)(NSString *meetID))success
                 failure:(void(^)(NSError *error))failure;

Parameters
Name Description
topic Topic for the meet.
delegate Callback interface to handle the delegates.
inviteAttendeesBlock Callback interface to notify the calling application when user clicks on the invite button.
success Callback interface to notify the calling application with meet ID after successful launch of Meet.
failure Callback interface to notify the calling application with error details when start meet failed.

Sample code:

// Start meet
[[Moxtra sharedClient]
            startMeet: @"Moxtra Meet"
         withDelegate: nil
 inviteAttendeesBlock: nil
              success: ^(NSString *meetID) {
                NSLog(@"Start meet successfully with MeetID [%@]", meetID);
            } failure: ^(NSError *error) {
                NSLog(@"Start meet failed, %@", [NSString stringWithFormat:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];

Invite Users to Meet

Invite users to join meet after successful start of meet. (N/A if your app is using Moxtra Identity to initialize the user).

- (void)inviteAttendeesWithUserIdentityArray :(NSArray*)userIdentityArray;

Parameters
Name Description
userIdentityArray Array of user identity to be invited for the meet.

Sample code:

[[Moxtra sharedClient] inviteMeetAttendees:[NSArray arrayWithObjects:@"unique ID of user to be invited", nil]
                                   success:^{
                                    NSLog(@"Invite attendees success.");
                                 } failure:^(NSError *error) {
                                    NSLog(@"Invite attendees failed, %@", [NSString stringWithFormat:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];

Join Meet

Join meet call to join an existing Moxtra meet session

- (void)joinMeet:(NSString*)meetID
        withUserName:(NSString*)userName
        withDelegate:(id)delegate
inviteAttendeesBlock:(void(^)(NSString *meetID))inviteAttendeesBlock
             success:(void(^)())success
             failure:(void(^)(NSError *error))failure;

Parameters
Name Description
meetID Moxtra meet ID.
userName Name of the user joining the meet.
delegate Callback interface to handle the delegates.
inviteAttendeesBlock Callback interface to notify the calling application when user clicks on the invite button.
success Callback interface to notify the calling application with meet ID after successfully joining the meet.
failure Callback interface to notify the calling application with error details when join meet failed.

Sample code:

//Join Moxtra Meet
[[[Moxtra sharedClient]
                joinMeet: meetID
            withDelegate: nil
    inviteAttendeesBlock: nil
                 success: ^(NSString *meetID) {
                    NSLog(@"Join meet success with MeetID [%@]", meetID);
               } failure: ^(NSError *error) {
                    NSLog(@"Join meet failed, %@", [NSString stringWithFormat:@"error code [%d] description: [%@] info [%@]", [error code], [error localizedDescription], [[error userInfo] description]]);
}];

Delegate Methods

The MXClientMeetDelegate protocol defines the methods that a delegate of a MoxtraSDK object may implement. The protocol declares methods that are implemented by your application to handle session callbacks.

meetEnded

Sent to the delegate when user end the Meet. Implement this method if you need to provide additional options to the user at the end of the Meet.

- (void)meetEnded;

beSupportInviteContactsBySMS

Implement this method if you need to disable the option for user to "Invite by SMS".

- (BOOL)beSupportInviteContactsBySMS;

beSupportInviteContactsByEmail

Implement this method if you need to disable the option for user to "Invite by Email".

- (BOOL)beSupportInviteContactsByEmail;

hideInviteButton

Implement this method if you need to hide the invite option and handle the invitation flow from your app.

- (BOOL)hideInviteButton;

supportAutoJoinAudio

Implment this method if you want the user to auto join the audio part of the Meet when they start or join.

- (BOOL)supportAutoJoinAudio;

supportAutoStartScreenShare

Implment this method if you want the user to share the app screen as soon as they start the Meet.

- (BOOL)supportAutoStartScreenShare;

bodyOfSMSContentWithMeetLink

Implment this method if you want to customize the content of SMS invitation.

- (NSString *)bodyOfSMSContentWithMeetLink:(NSString*)meetLink;

subjectOfEmailContent

Implment this method if you want to customize the subject of the email invitation.

- (NSString *)subjectOfEmailContent;

HTMLBodyOfEmailContentWithMeetLink

Implment this method if you want to customize the content of the email invitation.

- (NSString *)HTMLBodyOfEmailContentWithMeetLink:(NSString*)meetLink;

customizedInviteMessage

Implement this method to customize the content of the invitation message in the chat panel of Meet.

- (NSString *)customizedInviteMessage:(NSString *)meetLink
                    withBeJoinedAudio:(BOOL)beJoinedAudio 
                 withBeStartedSharing:(BOOL)beStartedSharing;

Push Notification

To configure push notification, you will first need to export your production certificate from Apple iOS Push Services. Upload the certificate and private key files to the app configuration in Moxtra. If your certificate is password protected make sure to provide the same when you upload the certificate.

Update Device Token

Use this method to update the device token in the Moxtra cloud.

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

Parameters
Name Description
deviceToken Device token to use for push notifications.

Sample code:

//Update device token
- (void)application:(UIApplication*)application
        didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
        {
            [[Moxtra sharedClient] updateRemoteNotificationsWithDeviceToken:deviceToken];
        }

Receive & Handle Push Notification

Handle the push notification received from the Apple Push Notification Service.

- (BOOL) receiveRemoteNotificationWithUserInfo:(NSDictionary*)userInfo;

Sample code:

//Receive Push Notification
- (void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *) userInfo {
    [[Moxtra sharedClient] receiveRemoteNotificationWithUserInfo:userInfo];
}


- (BOOL)receiveRemoteNotificationWithUserInfo:(NSDictionary*)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;

Sample code:

//Receive Push Notification
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
    [[Moxtra sharedClient] receiveRemoteNotificationWithUserInfo:userInfo fetchCompletionHandler:completionHandler];
}

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;

Sample code:

- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[Moxtra sharedClient] setBadgeNumberDidEnterBackground:0]; 
}