- Introduction
- Prerequisites
- Setup
- Project Settings
- Integration Steps
- Join Meeting
- Run Project
- Reference Classes
- Troubleshooting
In this documentation, we'll guide you through the process of installation, enabling you to enhance your iOS app with Jiomeet's real-time communication capabilities swiftly and efficiently. Let's get started on your journey to creating seamless communication experiences with Jiomeet eKYC SDK!
Before getting started with this example app, please ensure you have the following software installed on your machine:
- Xcode 14.2 or later.
- Swift 5.0 or later.
- An iOS device or emulator running iOS 13.0 or later.
You need to first register on Jiomeet platform. Click here to sign up
Create a new app. Please follow the steps provided in the Documentation guide to create apps before you proceed.
Use the create meeting api to get your room id and password
Please add below permissions keys to your Info.plist
file with proper description.
<key>NSCameraUsageDescription</key>
<string>Allow access to camera for meetings</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow access to mic for meetings</string>
Please enable Background Modes
in your project Signing & Capibilities
tab. After enabling please check box with option Audio, Airplay, and Pictures in Pictures
. If you don't enables this setting, your mic will be muted when your app goes to background.
Before joining the meeting please check audio video permissons are enabled or not. If not please throw an error to enable both audio and video permissons
Currently SDK support portarait orientation for the iPhone and landscape for the iPad. If your app supports multiple orientation, please lock down orientation when you show the SDK View.
Please add below pod to your Podfile and run command pod install --repo-update --verbose
.
pod 'JioMeetVideoKYCSDK_iOS', '1.0.0'
Also please add this lines in your pod file if you're facing any issues while compiling code.
post_install do |installer|
xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
# For xcode 15+ only
if config.base_configuration_reference && Integer(xcode_base_version) >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end
end
end
Please use below import statements
import JioMeetCoreSDK
import JioMeetVideoKYCSDK
Create instance of JMMeetingView
.
private var meetingView = JMMeetingView()
Add it to your viewController view.
meetingView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(meetingView)
NSLayoutConstraint.activate([
meetingView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
meetingView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
meetingView.topAnchor.constraint(equalTo: view.topAnchor),
meetingView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
])
First create JMJoinMeetingData
type object. Following are the properties of this object.
Property Name | Type | Description |
---|---|---|
meetingId | String | Meeting ID of the meeting user is going to join. |
meetingPin | String | Meeting PIN of the meeting user is going to join. |
displayName | String | Display Name with which user is going to join the meeting. |
let joinMeetingData = JMJoinMeetingData(
meetingId: "9680763133",
meetingPin: "1tKzt",
displayName: "John Appleased"
)
Create a JMJoinMeetingConfig
type object. Following are the properties of this object.
Property Name | Type | Description |
---|---|---|
userRole | JMUserRole | Role of the user in the meeting. Possible values are .host , .speaker , .audience . If you are assigning .host value, please pass the token in its argument. |
isInitialAudioOn | Bool | Initial Audio State of the user when user joins the meeting. If meeting is hard muted by a host, initial audio state will be muted and this setting will not take place. |
isInitialVideoOn | Bool | Initial Video State of the user when user joins the meeting. |
let joinMeetingConfig = JMJoinMeetingConfig(
userRole: .speaker,
isInitialAudioOn: true,
isInitialVideoOn: true
)
After creating JMJoinMeetingData
and JMJoinMeetingConfig
objects, call joinMeeting
method of JMMeetingView
instance.
Following are the arguments of joinMeeting
method.
Argument Name | Type | Description |
---|---|---|
meetingData | JMJoinMeetingData | Meeting Data which include meeting id, pin and user display name. |
config | JMJoinMeetingConfig | Meeting Configuration which include user role, mic and camera initial states. |
meetingView.joinMeeting(
meetingData: joinMeetingData,
config: joinMeetingConfig
)
Note: Host Token can be nil.
SDK has inbuilt methods related to eKYC. Methods are:
Summary
Show a face capture overlay. User can adjust his face that will fit inside overlay so that proper picture can be taken.
Declaration
public func showFaceCaptureOverlay()
Summary
Show a document capture overlay. User can adjust his document that will fit inside overlay so that proper picture of document can be taken.
Declaration
public func showDocumentCaptureOverlay()
Summary
Remove current photo or document capture overlay.
Declaration
public func removeCurrentOverlay()
Summary
Call this method to capture user photo. You will get UIImage
in completion handler if operation is successfull, and nil
if operation is failed.
Declaration
public func takePhotoSnapshot(completion: @escaping ((UIImage?) -> Void))
Summary
Call this method to capture document photo. You will get UIImage
in completion handler if operation is successfull, and nil
if operation is failed.
Declaration
public func takeDocumentSnapshot(completion: @escaping ((UIImage?) -> Void))
Summary
Flips user camera between front and rear camera of device.
Declaration
public func switchCamera()
Summary
Leave the meeting. You will get a callback when this operation is successfull. Please look at next section to more info about all callbacks.
Declation
public func leaveMeeting()
You can observer all events happening in the meeting related to all users. To observer these events, first confirm your class with JMClientDelegate
protocol and implement its methods. Also call addMeetingEventsDelegate
method of your meeting view and pass an UUID
type identifier.
let identifier = UUID()
meetingView.addMeetingEventsDelegate(delegate: self, identifier: identifier)
func jmClient(_ meeting: JMMeeting, didLocalUserJoinedMeeting user: JMMeetingUser) {
// Local User has Joined Meeting
}
func jmClient(_ meeting: JMMeeting, didLocalUserMicStatusUpdated isMuted: Bool) {
// Local User Mic status Updated
}
func jmClient(_ meeting: JMMeeting, didLocalUserVideoStatusUpdated isMuted: Bool) {
// Local User Video status Updated
}
func jmClient(_ meeting: JMMeeting, didRemoteUserJoinedMeeting user: JMMeetingUser) {
// Remote User has Joined Meeting
}
func jmClient(_ meeting: JMMeeting, didRemoteUserMicStatusUpdated user: JMMeetingUser, isMuted: Bool) {
// Remote User Mic status Updated
}
func jmClient(_ meeting: JMMeeting, didRemoteUserVideoStatusUpdated user: JMMeetingUser, isMuted: Bool) {
// Remote User Video status Updated
}
func jmClient(_ meeting: JMMeeting, didRemoteUserLeftMeeting user: JMMeetingUser, reason: JMUserLeftReason) {
// Remote User Left Meeting
}
func jmClient(_ meeting: JMMeeting, didLocalUserLeftMeeting reason: JMUserLeftReason) {
// Local User Left Meeting
navigationController?.popViewController(animated: true)
}
func jmClient(didLocalUserFailedToJoinMeeting error: JMMeetingJoinError) {
// Local User failed to join Meeting
var errorMessageString = ""
switch error {
case .invalidConfiguration:
errorMessageString = "Failed to Get Configurations"
case .invalidMeetingDetails:
errorMessageString = "Invalid Meeting ID or PIN, Please check again."
case .meetingExpired:
errorMessageString = "This meeting has been expired."
case .meetingLocked:
errorMessageString = "Sorry, you cannot join this meeting because room is locked."
case .failedToRegisterUser:
errorMessageString = "Failed to Register User for Meeting."
case .maxParticipantsLimit:
errorMessageString = "Maximum Participant Limit has been reached for this meeting."
case .failedToJoinCall(let errorMessage):
errorMessageString = errorMessage
case .other(let errorMessage):
errorMessageString = errorMessage
default:
errorMessageString = "Unknown Error Occurred."
}
showMeetingJoinError(message: errorMessageString)
}
func jmClient(didErrorOccured error: JMMeetingError) {
// Some error Occurred in Meeting. This will not end your meeting.
var errorMessage = ""
switch error {
case .cannotChangeMicStateInAudienceMode:
errorMessage = "You are in Audience Mode. Cannot update Mic status"
case .cannotChangeCameraStateinAudienceMode:
errorMessage = "You are in Audience Mode. Cannot update Camera status"
case .audioPermissionNotGranted:
errorMessage = "Mic permission is not granted. Please allow Mic permission in app setting."
case .videoPermissionNotGranted:
errorMessage = "Camera permission is not granted. Please allow Camera permission in app setting."
default:
errorMessage = "Some other error Occurred"
}
let errorAlertController = UIAlertController(title: "Error", message: errorMessage, preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default)
errorAlertController.addAction(okAction)
present(errorAlertController, animated: true)
}
Go to JioMeetVideoeKYCSample
folder, Run pod install --repo-update
command. Open JioMeetVideoeKYCSample.xcworkspace
file.
Please check MeetingScreenViewController
class for integration reference.
Please note, sample action button is for demo and simulation. In real world application, you will need websocket or Firebase or any other service for real time communication for calling eKYC related method from a remote agent.
Facing any issues while integrating or installing the JioMeet Template UI Kit please connect with us via real time support present in [email protected] or https://jiomeetpro.jio.com/contact-us