> 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/introduction.md).

# Introduction

This document provides instructions for software developers who want to create iOS software solutions that include MagTek devices connected to an iOS host. MagTek Universal SDK

(MTUSDK) incorporates MagTek SCRA and MagTek PIN Pad SCRA devices into one SDK. This document is part of a larger library of documents designed to assist MagTek device implementers.

The following are absolute prerequisites:

**·**       [<mark style="color:red;">**DynaFlex Family Programmer’s Manual**</mark> ](https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual)

### About the MagTek Sample Code <a href="#id-1.1_about_the_magtek_sample_code" id="id-1.1_about_the_magtek_sample_code"></a>

The sample code provides Swift demonstration source code and a reusable MTUSDK library that provides developers of custom software solutions with an easy-to-use interface for MagTek devices. Developers can distribute the MTUSDK library to customers or distribute internally as part of an enterprise solution.

### Nomenclature <a href="#id-1.2_nomenclature" id="id-1.2_nomenclature"></a>

* Device refers to the MagTek devices that receives and responds to command set.
* Host refers to the piece of general-purpose electronic equipment the device is connected or paired to, which sends data to and receives data from the device. Host types include but not limited to PC and Mac computers, tablets, and smartphones. When “host” must be used differently, it is qualified as something specific, such as “USB host.”
* User in this document generally refers to the cardholder.

### System Requirements <a href="#id-1.3_system_requirements" id="id-1.3_system_requirements"></a>

Tested operating systems:

* iOS 13 and above.
* Xcode 14 and above.

### Connect via WLAN <a href="#id-1.4_connect_via_wlan" id="id-1.4_connect_via_wlan"></a>

When connecting to the DynaFlex II PED device by WebSocket, a client certificate and its certificate chain must be installed on the iOS device.

The Root Certificate, Sub CA Certificate, and Client private key Certificate as referenced in document <mark style="color:red;">**DynaFlex TLS Certificate Installation Manual**</mark>. The client private key certificate (e.g. filename client.p12) must be accessible to the custom software that makes a secure WebSocket connection to the DynaFlex II PED.

After creating the certificates and transferring them in the iOS device, load the certificate chain into the iOS device by follow these steps. The certificate names shown here are for reference only.

1. &#x20;Delete the previously installed certificates prior to beginning this procedure. If the certificate chain is current, skip this installation section. View the certificates by going to Settings à General à VPN & Device Management.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FKNbT6bHT0zndAoUYEvFV%2Fimage.png?alt=media&amp;token=f555301e-0bca-4048-817a-3a7fabfa5873" alt=""><figcaption></figcaption></figure>

2. Copy the certificate chain to the iOS device. Touch the Root certificate DF-2-1\_RootCA.pem to download to iOS device.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FejILU6aq8driUTP3hHud%2Fimage.png?alt=media&amp;token=16a97582-91a5-4e6d-8afc-2d5ba6140cc0" alt=""><figcaption></figcaption></figure>

3. Go to Settings > General >VPN & Device Management > Select Root DF2-1

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2F5arEI1ZOX2bbK0NnS3dt%2Fimage.png?alt=media&amp;token=1d17ddcc-e75b-4fbd-9a83-19bccffe8fcd" alt=""><figcaption></figcaption></figure>

4. Select Install.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FzIekaCPxGdvSxhX3iF0f%2Fimage.png?alt=media&amp;token=82790268-036a-4b3e-be4d-eba1e2dcd677" alt=""><figcaption></figcaption></figure>

5. Enter Passcode.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FuFVpp9wibbSc5BPZcXd3%2Fimage.png?alt=media&amp;token=626eee99-53c0-49c2-86de-0fce8e20587d" alt=""><figcaption></figcaption></figure>

6. Press Install twice.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FE9B57atTnAIa6VijAECn%2Fimage.png?alt=media&amp;token=56dc651d-8ed2-4877-af09-f667e47c5a85" alt=""><figcaption></figcaption></figure>

7. Repeat the same steps above for the SubCA certificate Amce\_SubCA.pem and for the Client certificate Client.p12. For Client, iOS will ask for an additional certificate password, enter the password used during the creation of the Client certificate when prompted, and then press Next.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FTe7cQSNf2eXkOR54jRFP%2Fimage.png?alt=media&amp;token=900c2183-8644-4af7-88c9-c695c3a894e6" alt=""><figcaption></figcaption></figure>

8. Enable Certificates by going to Settings à About à Certificate Trust Settings

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2F5tjGrp318fJRPDe44cr2%2Fimage.png?alt=media&amp;token=c3009fd5-47c2-4e72-a856-b296cde1deff" alt=""><figcaption></figcaption></figure>

9. When building the custom app, the Client certificate must be loaded into the data member of CertificateInfo during the call to createDevice(). See below as an example to access the client certificate.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2Fr8QiYNicug6z1zgDhgjk%2Fimage.png?alt=media&amp;token=0bb99085-81fd-4797-a3cf-aa27c915a921" alt=""><figcaption></figcaption></figure>

### Connect via Bluetooth LE <a href="#id-1.5_connect_via_bluetooth_le" id="id-1.5_connect_via_bluetooth_le"></a>

The following instructions are for Bluetooth pairing the DynaFlex II Go.

1. Place the device into Pairing Mode by pressing and holding the power button on device until 4 beeps and release the button. The 4th LED will blink green.

<figure><img src="https://4093728396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwjbnqo0srzj14AwQMHQM%2Fuploads%2FfhyVIa1TCpEZurnXBHNy%2Fimage.png?alt=media&amp;token=0e7d1aab-0ea4-41d2-b8ac-8b597c2c4542" alt=""><figcaption></figcaption></figure>

2. When in pairing mode and the first time connecting to device, the host will prompt for a pairing request. Enter the pairing code. The default code is "000000".


---

# 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/introduction.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.
