Setup and Basic Usage - Gruveo SDK for iOS

Setup and Basic Usage

This page explains how you can get started quickly with the Gruveo SDK for iOS.

Requirements

The Gruveo SDK for iOS supports iOS 9 and higher.

Since the SDK accesses the device’s camera and microphone, you will need to add the NSCameraUsageDescription and NSMicrophoneUsageDescription keys to your application’s Info.plist, with string values explaining to the user how the app uses this data.

You will need to set “Enable Bitcode” to NO in your build settings. Go to Target -> Build Settings -> Enable Bitcode to do so.

Finally, to allow the calls to continue in the background, check the “Audio, AirPlay, and Picture in Picture” checkbox under Capabilities -> Background Modes.

Setup

If you don’t have CocoaPods installed, install it with the following command:

Then, add the GruveoSDK pod to your Podfile:

Finally, run the following command in your project directory:

Launching a Gruveo Screen

First, import the Gruveo SDK in your AppDelegate and ViewController as follows:

Then, register your client ID after application startup in your AppDelegate:

Once the above are in place, the ViewController sample below will launch a Gruveo screen to connect to the gruveorocks call room.

Let’s break down this example.

  • On line 3, we set the delegate for GruveoCallManager.
  • On line 4,  the Gruveo screen is initialized and instructed to connect to the gruveorocks call room. We pass YES in the videoCall parameter to start the call with the camera on, as well as supply a callback block to be called in case of an initialization error. Check out SDK Reference for more details on the initialization.
  • The delegate function on lines 11-28 implements a mandatory handler for the requestToSignApiAuthToken event used for SDK authentication. It uses a server endpoint provided by Gruveo to sign tokens for the demo client ID as part of the authentication scheme. Note that when using a production client ID, you will need your own endpoint as well as a way to authenticate your app with it.
  • On lines 30-32, other SDK delegate functions are implemented.