Integrating the iOS SDK
Adding the Switchboard SDK to Your Project
Download the iOS SDK and add the SwitchboardSDK.xcframework
file in Xcode under Frameworks, Libraries and Embedded Content. Make sure to select Embed & Sign in the Embed column.
Microphone Permission
If your app uses the microphone you need to set the NSMicrophoneUsageDescription
key in your project's Info.plist file. You can find more information about this flag here.
Initializing the SDK
Before you make any calls to the Switchboard SDK you need to initialize it. A typical place to do this is the AppDelegate
class but you can do this anywhere in your project.
Please get in touch to get your clientID
and clientSecret
values.
- Swift
- Objective-C
import UIKit
import SwitchboardSDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
SwitchboardSDK.initialize(
clientID: "Your client ID",
clientSecret: "Your client secret"
)
return true
}
...
}
#import "AppDelegate.h"
#import <SwitchboardSDK/SwitchboardSDK.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
[SwitchboardSDK initializeWithClientID:@"Your client ID" clientSecret:@"Your client secret"];
}
...
@end