The Calls SDK for iOS is used to initialize, configure, and build voice and video calling functionality into your iOS application. This repository contains a sample application intended to demonstrate a simple implementation of this framework, as well as the preliminary steps of implementing the Calls SDK into your own project.
- Mac OS with developer mode enabled
- Xcode
- Git Large File Storage installed
- Homebrew
- At least one physical iOS device running iOS
10.0+
To download SendBirdWebRTC
, you first MUST install Git LFS by running the following command
$ brew install git-lfs
Please refer to https://git-lfs.github.com
Open a terminal window, navigate to your project directory, and then open your Podfile
by running the following command.
$ open Podfile
Make sure that the Podfile
includes the following:
platform :ios, '9.0'
target 'YourProject' do
use_frameworks!
pod 'SendBirdCalls'
end
And then install the SendBirdCalls
framework via CocoaPods
$ pod install
Important: Make sure to install Git LFS before installing the pod. Check the size of
WebRTC.framework
inSendBirdWebRTC
folder. It MUST be over 800 MB. If your loaded SendBirdWebRTC framework is smaller than that, check your Git Large File Storage settings and download again. Refer to SDK’s troubleshooting section.
- Login or Sign-up for an account at dashboard.
- Create or select an application on the SendBird Dashboard.
- Note the
Application ID
for future reference. - Contact sales to get the
Calls
menu enabled in the dashboard. (Self-serve coming soon.)
- In the SendBird dashboard, navigate to the
Users
menu. - Create at least two new users, one that will be the
caller
, and one that will be thecallee
. - Note the
User ID
of each user for future reference.
As shown below, the SendBirdCall
instance must be initiated when a client app is launched. Initialization is done by using your APP_ID
of your SendBird application in the dashboard. This App ID of the SendBird application must be specified inside the sample application’s source code.
Find the application(_:didFinishLaunchingWithOptions:)
method from AppDelegate.swift
. Replace YOUR_APP_ID
with the App ID
of the SendBird application created previously.
SendBirdCall.configure("YOUR_APP_ID")
- Verify that Xcode open on the development Mac and the sample application project is open
- Plug the primary iOS device into the Mac running Xcode
- Unlock the iOS device
- Run the application by pressing the
▶
Run button or typing⌘+R
- Open the newly installed app on the iOS device
- If two iOS devices are available, repeat these steps to install the sample application on both the primary device and the secondary device.
In order to make and receive calls, authenticate the user with SendBird server with the SendBirdCall.authenticate(with:)
method and register a VoIP push token to SendBird. You can register a VoIP push token during authentication by either providing it as a parameter in the authenticate()
method, or after authentication has completed using the SendBirdCall.registerVoIPPush(token:)
method. VoIP Push Notification will also enable receiving calls even when the app is in the background or terminated state. A valid APNS certificate also needs to be registered on the SendBird Dashboard
: Application
→ Settings
→ Notifications
→ Add certificate
.
To handle a native-implementation of receiving incoming calls, you can choose to implement Apple’s PushKit framework and CallKit. This is done by registering device tokens associate with your SendBird Applications. For more information refer to Apple’s Voice Over IP (VoIP) Best Practices
- Log in to the primary device’s sample application with the ID of the user designated as the
caller
. - Log in to the secondary device’s sample application with ID of the user designated as the
callee
. Alternatively, use the Calls widget found on the Calls dashboard to login as thecallee
. - On the primary device, specify the user ID of the
callee
and initiate a call. - If all steps have been followed correctly, an incoming call notification will appear on the
callee
user’s device. - Reverse roles, and initiate a call from the other device.
- If the
caller
andcallee
devices are near each other, use headphones to prevent audio feedback.