Integrating the macOS SDK
Adding the Switchboard SDK to Your Project
Download the macOS 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.
To initialize our SDK in your project, please sign up here to receive your appID
and appSecret
values.
It is essential to initialize the Switchboard SDK before any other Extension.
- Swift
- Objective-C
import Cocoa
import SwitchboardSDK
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
SwitchboardSDK.initialize(
appID: "Your app ID",
appSecret: "Your app secret"
)
}
...
}
#import "AppDelegate.h"
#import <SwitchboardSDK/SwitchboardSDK.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[SwitchboardSDK initializeWithAppID:@"Your app ID" appSecret:@"Your app secret"];
return YES;
}
...
@end