Swiftpack.co - Package - cafexcomms/cafex-meetings-ios

CafeXMeetingsSDK

This CocoaPod is used to access the CafeX Meetings service from a native iOS application. The minimum iOS version supported is 10.0.

A description of the CafeX Meetings service is available here: https://www.cafexmeetings.com/

And the location of the cloud service for it is: https://meetings.cafex.com/

Version information

This is version 2.4.11 of the CafeX-Meetings library.

This release fixes an issue where participant views sometimes did not appear (happened in particular on iPads, when joining later than most users).

For full release notes information, please consult the CHANGELOG.md file.

Installation

Via CocoaPods

CafeXMeetingsSDK is available through CocoaPods

To install the CafeX Meetings iOS SDK to your project add the following to your Podfile:

pod "CafeXMeetingsSDK"

and enter the following in to your commandline at the working directory of your podfile

pod install --repo-update

If your project already uses CafeX-Meetings then it will be necessary to update the dependency using the command:

pod update CafeXMeetingsSDK

CocoaPods will confirms the update by logging a message similar to the following one:

Installing CafeXMeetingsSDK 2.4.11 (was 2.4.x)

Manual

To manually install, download the framework CafeXMeetingsSDK.zip, unpack it. Then drag and drop the CafeXMeetingsSDK.xcodeproj file into to root of your XCode project.

Then you need to do the following:

  • In your target "Build Phases", add the CafeXMeetingsSDK in the "Target Dependencies" section.
  • In your project general settings, you click the '+' button in the "Embedded Binaries" section in order to select and add the CafeXMeetingsSDK.framework.

CafeXMeetingsSDK also relies on WebRTC.framework, which can be found here (or you can follow the build instructions here).

You will need to unzip it and copy the WebRTC.framework file (as well as the .dSYM) into the Frameworks folder of the unpacked CafeXMeetingsSDK source. This is important as the CafeXMeetingsSDK project file expects it to be there (and it won't compile otherwise).

You then you need to do the following:

  • In your project general settings, you click the '+' button in the "Embedded Binaries" section in order to select and add the WebRTC.framework.

The project should then compile successfully.

Usage

To call CHConference functions use

import CafeXMeetingsSDK in swift, #import "CafeXMeetingsSDK.h" in Objective-C

The entry point of the CafeXMeetingsSDK framework is the ConferenceViewController. To present a conference use the following code from the current viewController:

let conferenceViewController = ConferenceViewController()
//setup conferenceViewController frame with view.frame or autolayout constraints e.g
conferenceViewController.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
//set host address of the CafeX Meetings server instance
conferenceViewController.setHostURL(hostURL: "https://yourserver.com:8443/")
//add the view to the current view controller and add the conference view controller as a child.
self.view.insertSubview(conferenceViewController.view, belowSubview: self.cancelButton)
self.addChildViewController(conferenceViewController)
//join the conference
conferenceViewController.join(meetingId: "meetingID")
})

If using storyboard the ConferenceViewController can be embedded in another view controller using the Container View element:

Screen Shot 2017-06-07 at 13.59.33.png

In order to make the embedded view controller a ConferenceViewController, click on the embedded view controller and Change the custom class to "ConferenceViewController" and the Module to "CHConference"

Screen Shot 2017-06-07 at 14.01.12.pngScreen Shot 2017-06-07 at 14.03.19.png

In order to set the options for our conference, first select the segue in the storyboard and give it a unique identifier Screen Shot 2017-06-07 at 14.07.24.png

In your embedding view implement the following:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
    if segue.identifier == "embedConferenceView" {
        dest.setHostURL(hostURL: "https://yourserver.com:8443/")
        dest.join(meetingID: "meetingId")
    }
}

Delegate Functions

The ConferenceViewController will inform your application of meeting events through the ConferenceViewControllerDelegate protocol. To receive these events, register a delegate that conforms to this protocol, eg:

class viewController: UIViewController, ConferenceViewControllerDelegate {
    ...
    conferenceViewController.delegate = self
    ...
}

The following is an overview of the events raised through the protocol:

Meeting Started

Called when this device's user first joins a meeting

func meetingStarted() {
    print("ConferenceViewControllerDelegate : Meeting Started")
}

Meeting Ended

Called when this device's user leaves the meeting

func meetingEnded() {
    print("ConferenceViewControllerDelegate : Meeting Ended")
}

Join Failed

Called if joining a conference fails. See also conferenceViewController:DidRecieveError:

func joinFailed() {
    print("ConferenceViewControllerDelegate : joinFailed")
}

Participant Joined

Called when a participant joins the meeting

func participantJoined(userDetails: UserDetails) {
    print("ConferenceViewControllerDelegate : participantJoined")
}

Participant Updated

Called when information on a participant is updated

func participantUpdated(userDetails: UserDetails) {
    print("ConferenceViewControllerDelegate : participantUpdated")
}

Participant Left

Called when a participant leaves the meeting

func participantLeft(userDetails: UserDetails) {
    print("ConferenceViewControllerDelegate : participantLeft")
}

Conference view controller did receive error

Called when an error occurs during the meeting

func conferenceViewController(_ controller: ConferenceViewController, didRecieveError error: NSError) {
    print("ConferenceViewControllerDelegate : didReceiveError")
}

Conference view controller did finish connecting to conference

Called when our view controller finishes connecting to the conference

func conferenceViewController(_ contoller: ConferenceViewController, didFinishConnectingToConference conference: String) {
    print("ConferenceViewControllerDelegate : didFinishConnectingToConference: \(conference)")
}

Audio Event

Called when the state of the out-going audio is changed, e.g muted and and unmuted

func audioEvent(state: String) {
    print("Audio event received: \(state)")
}

Camera Event

Called when the state of out-going video is changed, e.g camera turned on or off

func cameraEvent(state: String) {
    print("Camera event received: \(state)")
}

Send Chat Message

Called when a chat message has been sent by the user

func sendChatMessage(messageContent: String) {
    print("Chat message send: \(messageContent)")
}

Received Chat Message

Called when a chat message is received

func receivedChatMessage(messageContent: String, from: [String: Any]) {
    print("Chat message received from: \(from["name"] as! String) message content: \(messageContent)")
}

Document Share Event

Called when a document share is started or ended

func docShareEvent(event: String) {
    print("Doc share event received: \(event)")
}

Screen Share Event

Called when a Screen share is started or ended

func screenShareEvent(event: String) {
    print("Screen share event received: \(event)")
}

Support

For support please contact support@cafex.com

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0