# Getting started

## Step1: Get your Platform keys

Your API requests are authenticated using **Platform keys**. Any request that doesn't include a platform key will return an error.

You can generate a Platform key from your Trill Dashboard at any time.&#x20;

Access the Trillbit developer portal <https://developers.trillbit.com/>.

## Step 2: Setup procedure

### 1. Add Framework on application.

Go to Build Setting -> General -> Frameworks, Libraries and Embedded Content

<figure><img src="https://2438813291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPXBP9297ASMfJRBABodN%2Fuploads%2Fozk7VRdN4zV2E7ERHpkO%2FScreenshot%202022-11-08%20at%204.51.53%20PM.png?alt=media&#x26;token=752349a4-9b96-4a83-993d-e86e2c115848" alt=""><figcaption></figcaption></figure>

### 2. Add Header and Framework Search Path Framework on application.

Go to Build Setting -> General -> Framework search path / Headers search path

<figure><img src="https://2438813291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPXBP9297ASMfJRBABodN%2Fuploads%2FN9uONfG5TKZuFRFgUgXa%2FScreenshot%202022-11-08%20at%204.52.07%20PM.png?alt=media&#x26;token=14d1b98b-9a46-497d-b218-05c209086734" alt=""><figcaption></figcaption></figure>

### 3. Make sure audio permission are added in info.plist

<figure><img src="https://2438813291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPXBP9297ASMfJRBABodN%2Fuploads%2FYUKJvc2WXDZWf7jIxvqw%2FScreenshot%202022-11-08%20at%204.52.21%20PM.png?alt=media&#x26;token=f3a800f7-c2b7-4d75-9558-a3fdc0c390ff" alt=""><figcaption></figcaption></figure>

### 4. Instantiate TrillSDK Callbacks

Initialize callback inside App Delegates.

```
class AppDelegate: UIResponder, UIApplicationDelegate, TrillCallBackDelegates {
func onError(_ error_code: Int32, _ error: String!) {
print(error);
}
func onInfo(_ info_code: Int32, _ info: String!) {
print(info)
}
func onSDKReady() {
print ("SDK is ready to use");
}
func onPlayingCompleted() {
print ("Playing Completed");
}
func onSendingCompleted() {
print ("Sending Completed with all repeats.");
}
func onDecoded(_ payload: String!) {
print (payload);
}
func onErrorDecoding() {
print (onErrorDecoding);
}

```

### 5. Initialize TrillSDK

To initialize TrillSDK all we need to do is to create TrillSDK Class object with SDK\_KEY, boolean flag (

is\_sender\_only\_sdk and delegate class ) where

<mark style="color:blue;">**`SDK_KEY: Your SDK credential key (get it from developers portal)`**</mark>

<mark style="color:blue;">**`is_sender_only: Turn it on if you want your device to work only as a sender`**</mark>

<mark style="color:blue;">**`device, this wont require recording permissions.`**</mark>

<mark style="color:blue;">**`delegates_class: object reference to callbacks class.`**</mark>

##

## Step 3: Licensing TrillBit iOS SDK for your application

For Licensing the TrillBit SDK for your application:

Replace YOUR\_SDK\_KEY with the Key displayed on your TrillBit developer portal dashboard(iOS).

```
String SDK_KEY = "SDK_KEY_FROM_TRILL_DEV_PORTAL";
```

```
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
trill = TrillSDK(delegates: "YOUR_SDK_KEY", false, self);
trill?.initialise();
return true
}
```
