> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/ios/iconfigurationcallback-delegates.md).

# IConfigurationCallback Delegates

This interface invokes a callback function to receive data and/or a detailed response. To use, a class must implements the IConfigurationCallback Delegates interface.

### OnCalculateMAC <a href="#id-13.1_oncalculatemac" id="id-13.1_oncalculatemac"></a>

This event is called when certain asynchronous IDeviceConfiguration operations need to have a MAC included with the request.

{% code overflow="wrap" %}

```
(IResult*) OnCalculateMAC: (unsigned char) macType
        data: (NSData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="156.27276611328125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">macType</td><td valign="top">Type of Mac algorithm. For DynaFlex, use 0.</td></tr><tr><td valign="top">data</td><td valign="top">Contains the data of the payload to MAC.</td></tr></tbody></table>

Return Value:

Returns an IResult\* that contains the calculated MAC.

### OnProgress <a href="#id-13.2_onprogress" id="id-13.2_onprogress"></a>

This event is called to update the host on the progress of an asynchronous IDeviceConfiguration operation.

{% code overflow="wrap" %}

```
(void) OnProgress: (int) Progress;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="139.00006103515625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>progress</p></td><td valign="top"><p>The progress of the configuration operation. Range:</p><p>0 - 100</p></td></tr></tbody></table>

Return Value: None

### OnResult <a href="#id-13.3_onresult" id="id-13.3_onresult"></a>

This event is called to update the host when an asynchronous IDeviceConfiguration operation is completed.

{% code overflow="wrap" %}

```
(void) OnResult: (MTU_StatusCode) status 
        data: (NSData*) data;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="160.8182373046875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">status</td><td valign="top">An enumerated MTU_StatusCode.</td></tr><tr><td valign="top">data</td><td valign="top">Contains the data for the event.</td></tr></tbody></table>

Return Value: None

**Example**:

<pre data-overflow="wrap"><code>interface MTUSDK_DynaFlex : &#x3C;IConfigurationCallback>
func OnCalculateMAC(_ macType: UInt8, data: Data) -> IResult
        {
                // Event handler
        }

func onProgress(_ progressValue: Int32)
        {
                // Event handler
        }
func onResult(_ status: MTU_StatusCode, data: Data)
        {
<strong>                // Event handler
</strong>        }
</code></pre>

<br>

&#x20;

<img src="file:///C:/Users/Allenr/AppData/Local/Temp/msohtmlclip1/01/clip_image002.gif" alt="" height="239" width="632">


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/ios/iconfigurationcallback-delegates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
