Implement iOS UI Kit

After the required permissions are granted and a valid token is obtained, you can start using the Enx_UIKit_iOS framework.

Pre-requisites

To use the Enx_UIKit_iOS Framework user must have the following:

  • A valid Token to join the room
  • Camera permission
  • Mic permission

Get Camera and Mic permission

private func getPrivacyAccess(){
let vStatus = AVCaptureDevice.authorizationStatus(for: .video)
if(vStatus == AVAuthorizationStatus.notDetermined){
AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in
})
}
let aStatus = AVCaptureDevice.authorizationStatus(for: .audio)
if(aStatus == AVAuthorizationStatus.notDetermined){
AVCaptureDevice.requestAccess(for: .audio, completionHandler: { (granted: Bool) in
})
}
}

Add NSCameraUsageDescription and NSMicrophoneUsageDescription in your app-> info.plist.

Implementation

Import Necessary Packages

  • Go to your class and import the Enx_UIKit_iOS.

Example: Swift

import Enx_UIKit_iOS

Example: Objective-C

@import Enx_UIKit_iOS;
@class Enx_UIKit_iOS;
@interface yourmainclass: UIViewController

Initialize and Set Up the EnxVideoViewclass

  • Initiate EnxVideoViewClass to pass a valid token and use a delegate to receive callback.

Example: Swift

//Initiate the EnxVideoViewClass
let enxViewer = EnxVideoViewClass(
token: "A valid Room Token",
delegate: self,
embedUrl: "Low-Code Embed URL. Optional to import Settings"
)
//Add it to your view
view.addSubview(enxViewer)
//Set the frame
enxViewer.frame = self.view.bounds
//Set the constraint to auto manage UI if orientation change
enxViewer.autoresizingMask = [.flexibleWidth, .flexibleHeight]

Example: Objective-C After import done, go to .m class

//Initiate the EnxVideoViewClass
EnxVideoViewClass *videoView = [[EnxVideoViewClass alloc]
initWithToken:@"A aalid Room Token"
delegate:self
embedUrl:"Low-Code Embed URL. Optional to import Settings"];
//Add it to your view
[self.view addSubview:videoView];
//Set the frame
videoView.frame = self.view.bounds;
//Set the constraint to auto manage UI if orientation change
videoView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight);

Here you need to create an instance of EnxVideoView which is the subclass of UIView. You need to pass a valid Token and use Delegate to receive callback.