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:
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 EnxVideoViewClasslet enxViewer = EnxVideoViewClass(token: "A valid Room Token",delegate: self,embedUrl: "Low-Code Embed URL. Optional to import Settings")//Add it to your viewview.addSubview(enxViewer)//Set the frameenxViewer.frame = self.view.bounds//Set the constraint to auto manage UI if orientation changeenxViewer.autoresizingMask = [.flexibleWidth, .flexibleHeight]
Example: Objective-C After import done, go to .m class
//Initiate the EnxVideoViewClassEnxVideoViewClass *videoView = [[EnxVideoViewClass alloc]initWithToken:@"A aalid Room Token"delegate:selfembedUrl:"Low-Code Embed URL. Optional to import Settings"];//Add it to your view[self.view addSubview:videoView];//Set the framevideoView.frame = self.view.bounds;//Set the constraint to auto manage UI if orientation changevideoView.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.