Qiscus RTC SDK is a product that makes adding voice calling to mobile apps easy. It handles all the complexity of signaling and audio management while providing you the freedom to create a stunning user interface. We highly recommend that you implement a better push notification for increasing call realiability, for example APNs, Pushkit, MQTT, or other standard messaging protocol.
Callkit support
Below is a step-by-step guide on setting up the Qiscus RTC SDK for the first time
Add to your project podfile
platform :ios, '10.0'
pod 'QiscusRTC'
import QiscusRTC
Add to your project info.plist camera and microphone
add this in .plist
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
<string>audio</string>
<string>voip</string>
</array>
Init Qiscus at your application
Parameters:
- app_id: String
- app_secret: String
QiscusRTC.setup(appId: [Your_AppID], appSecret: [Your_Secret_Key])
To get your app_id
and app_secret
, please contact us.
Qiscus also provides on-premise package, so you can host signaling server on your own network. Please contact us to get further information.
Parameters:
- app_id: String
- app_secret: String
- host: String
QiscusRTC.setup(appId: [Your_AppID], appSecret: [Your_Secret_Key], host: [Your_server])
Before user can start call each other, they must register the user to our server
Parameters:
- username: String
- displayName: String
QiscusRTC.register(username: "[email protected]", displayName: "juang")
Start Call, as callee you can call anyone with username. You can define roomId or leave it and we can generate random room id.
Start call object:
- roomId: String
- calleeUsername: String
- calleeDisplayName: String
- isVideo: Bool
- calleeDisplayAvatar: URL
QiscusRTC.startCall(roomId: "unique_room_id", isVideo: true/true, calleeUsername: "[email protected]", calleeDisplayName: "Evan P", calleeDisplayAvatar: URL(string: "http://...") { (target, error) in
if error == nil {
self.present(target, animated: true, completion: nil)
}
}
When you receive a signal, message or event incoming call. You must set roomID and caller username to autenticate call.
Start call object:
- roomId: String
- calleerUsername: String
- calleerDisplayName: String
- isVideo: Bool
- calleerDisplayAvatar: URL
QiscusRTC.incomingCall(roomId: "receive_room_id", isVideo: false/true, calleerUsername: "[email protected]", calleerDisplayName: "juang", calleerDisplayAvatar: URL(string: "http://...") { (target, error) in
if error == nil {
self.present(target, animated: true, completion: nil)
}
}
when you receive call in background or lock screen, then you open the app you need to redirect view to call screen.
if QiscusRTC.isCallActive {
let target = currentViewController()
let callUI = QiscusRTC.getCallUI()
target.navigationController?.present(callUI, animated: true, completion: {
// Your Code
})
}