Let's integrate our SDK in few minutes
#
Getting started#
Introduction#
Requirements- iOS 12.1 and above
#
InstallationThe SDK is already compiled into a Framework. To use the SDK, the below frameworks has to be imported into the project.
STEPS:
- Create a new iOS project or Open a existing project
- Add the following frameworks to the project
- FlyCall.framework
- FlyCommon.framework
- FlyNetwork.framework
- Add the following dependencies in podfile.
#
Initial setupSDK requires some initial configurations to be set in your application class. Initialize the below CallSDK builder in your app's AppDelegate's didFinishLaunchingWithOptions
method
- Swift
- Objective-C
Argument | Type | Description |
---|---|---|
USER_ID | String | Unique Id of the User |
BASE_URL | String | Base url for API Service |
SIGNAL_SERVER_URL | String | URL of the Signal Server |
JANUS_SERVER_URL | String | URL of the Janus Server |
APP_GROUP_ID | String | Id of the app group |
ICE_SERVER_LIST | [RTCIceServer] | Ice servers list( STUN,TURN) |
CALLMANAGER_DELEGATE | CallManagerDelegate | Delegate provided by the call sdk |
CALL_VIEW_CONTROLLER | UIViewController | ViewController which needs to be presented during outgoing call. |
Note:
- RTCIceServer is the class on GoogleWebrtc. Pass an array of RTCIceServers in ICE_SERVERS_LIST(STUN and TURN servers)
info
Call the above builder after the unique user id is available and in the AppDelegate's didFinishLaunchingWithOptions
with a condition of isLoggedin
or isUserId available logic based on your app.
#
App CapabilitiesCall SDK also requires the application to enable the below capabilities for voip calls to function seamlessly without any issues.
Capabilities |
---|
Audio,Airplay, and Picture in Picture |
Voice over IP |
Background fetch |
Remote notifications |
#
Push and Voip NotificationsTo receive calls in the background and in killed state, kindly register for remote as well for voip notification by conforming to the following delegates in the AppDelegate UNUserNotificationCenterDelegate
PKPushRegistryDelegate
.
Call the below methods when an APNS token or VOIP token gets updated.
- Swift
- Objective-C
Argument | Description |
---|---|
TOKEN | Apns or Voip Token |
In class that extends the UNNotificationServiceExtension
after validating whether the received payload is for call or not, call the below method
to process the call further.
- Swift
- Objective-C
Argument | Type | Description |
---|---|---|
NOTIFICATION_CONTENT | UNMutableNotificationContent | Notification request content |
COMPLETION_BLOCK | (UNMutableNotificationContent?) -> Void | Completion Block |
Send the payload received through VOIP from the method didReceiveIncomingPushWith
to the method below to process the call further.
- Swift
- Objective-C
Argument | Description |
---|---|
PAYLOAD | Payload Dictionary |
#
RegistrationTo register a new user use the below method,
- Swift
- Objective-C
Argument | Type | Description |
---|---|---|
USER_IDENTIFIER | String | Unique Id to Register the User |
APNS_TOKEN | String | APNS device token |
VOIP_TOKEN | String | VOIP Push device token |
#
App Group IdIn order to access data between app and notification extension, enabling app group is mandatory, and a group container id is necessary for call sdk to function properly.
- Swift
- Objective-C
Argument | Description |
---|---|
APP_GROUP_ID | Id of the application App group |
info
Sets the group container id in AppDelegate's didFinishLaunchingWithOptions
method
and in the didReceive
methods of the class that extends UNNotificationServiceExtension
before calling any other Call SDK methods even before the Call SDK Builder method.
#
Presenting the call UICall SDK handles the UI presentation for an outgoing call. Call the below method after declaring the Call SDK and or before making a call.The below method sets the view on top of which the call ui will be presented.
- Swift
- Objective-C
Argument | Description |
---|---|
VIEW_TO_PRESENT | ViewController in which Call UI has to be presented. |