# Trill SDK Callbacks and delegates

```
(void) onError: (int) error_code: (NSString*) errror;
```

The callback is triggered in case of any error. The callback returns back error code with the error

message as string.

```
(void) onInfo: (int) info_code: (NSString*) info;
```

The callback is triggered in the case when SDK needs to pass any information to the main

application. The callback returns back info code with the info message as string,

```
(void) onSDKReady;
```

The callback is triggered once SDK is initlised and ready to be used for sending and receiving

purpose.

```
(void) onPlayingCompleted;
```

The callback is triggered once SDK has completed playing, If the playing method is called with

repeat count 3 the callback will be received 3 times for every play completed

```
(void) onSendingCompleted;
```

The callback is triggered once SDK has completed the sending process If the playing method is

called with repeat count 3 the callback will be received when playing is completed for the 3rd time.

```
(void) onDecoded:(NSString*) payload;
```

The callback is triggered when SDK has received the TrillTone. Use the callback to receive decoded data on the main application.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillbit.gitbook.io/trillbit-sdk/ios-support/trill-sdk-for-ios/methods-and-callbacks/trill-sdk-callbacks-and-delegates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
