# Set up the SDK

Add the Tap to Pay on iPhone SDK to your Xcode project, link the libraries, and configure your build settings.

**Prerequisites:** [Authentication](/api/authentication)

To set up the SDK and start integrating, add the Tap to Pay on iPhone SDK to your Xcode project, and then configure your build settings.

<a id="integration-steps"></a>
## Integration steps

1. Download the SDK package.
2. Extract the archives.
3. Link the libraries to your app.
4. Copy the resources to your project.
5. Add your API key.
6. (Optional) Create a Swift bridging header.
7. Update your build settings.

<a id="step-1-download-the-sdk-package"></a>
## Step 1. Download the SDK package

- Go to our [Tap to Pay on iPhone GitHub repository](https://github.com/pyrc-ghe-engineering/pyrc-sdk-tap_to_pay_iphone), and then from the Releases section, download the latest package.

<a id="step-2-extract-the-archives"></a>
## Step 2. Extract the archives

1. Extract the contents from the **PayrocTapToPayOniPhoneSDK** zip folder. The package contains the following folders and files:

| **Folder or file** | **Description** |
| --- | --- |
| docs/ | HTML documentation and a script to load the documentation on your computer. |
| iosSample/ | [Sample apps](/guides/payments/tap-to-pay-on-iphone/run-the-sample-apps) that we've created using Swift and Objective-C. |
| libs/ | SDK and plugin static libraries. |
| payconfig.xml | Configuration file that contains the gateway URLs and your API key. |

2. Go to the **libs** folder, and then extract the following zip folders:
   
   - **gochip-applettp\*.zip**
   - **gochip-sdk\*.zip**

<a id="step-3-link-the-libraries-to-your-app"></a>
## Step 3. Link the libraries to your app

1. In Xcode, open your project, and then select your project in the **Project navigator**.
2. From the **TARGETS** list, select your app.
3. Select the **Build Phases** tab.
4. Expand **Link Binary With Libraries**, and then select **+**.
5. Add each of the following libraries:
   
   - **libAFNetworking\*.a**
   - **libc++.tbd**
   - **libgochip-common\*.a**
   - **libgochip-restconnector\*.a**
   - **libgochip-sdk\*.a**
   - **libgochip-applettp\*.a**
   - **libISO8601\*.a**
   - **libJSONModel\*.a**

<a id="step-4-copy-the-resources-to-your-project"></a>
## Step 4. Copy the resources to your project

- Copy the following files to the root of your app project:
  
  - **PayrocTapToPayOniPhoneSDK/libs/Core.h**
  - **PayrocTapToPayOniPhoneSDK/payconfig.xml**

<a id="check-that-xcode-copied-payconfigxml-into-your-app"></a>
### Check that Xcode copied payconfig.xml into your app

If the **payconfig.xml** file isn't in **Copy Bundle Resources**, your app builds successfully but can't reach our gateway.

To check that Xcode copied **payconfig.xml** into your app when it builds, complete the following steps:

1. From the **TARGETS** list, select your app, and then select the **Build Phases** tab.
2. Expand **Copy Bundle Resources**.
3. Check that the **payconfig.xml** file appears in the list.
4. (Optional) If the **payconfig.xml** file isn't in the list, select **+**, and then add it.

<a id="step-5-add-your-api-key"></a>
## Step 5. Add your API key

- In the **payconfig.xml** file, enter your API key and integration ID.

**Note:** We provided you with your API key and integration ID when you boarded with us.

<a id="step-6-optional-create-a-swift-bridging-header"></a>
## Step 6. (Optional) Create a Swift bridging header

If you're using Objective-C, go to [Step 7. Update your build settings](#step-7-update-your-build-settings).

If you're using Swift, you need to create a Swift bridging header. To create a Swift bridging header, complete the following steps:

1. Create a file named **\[YourAppName\]-Bridging-Header.h** in the root of your project.
2. Add the following code to the file:
   
   ```objectivec
   #ifndef [YourAppName]_Bridging_Header_h
   #define [YourAppName]_Bridging_Header_h
   
   #import "Core.h"
   
   #endif /* [YourAppName]_Bridging_Header_h */
   ```

<a id="step-7-update-your-build-settings"></a>
## Step 7. Update your build settings

1. From the **TARGETS** list, select your app, and then select the **Build Settings** tab.
2. In the search box, search for **Other Linker Flags**, and then set its value to `-ObjC`.
3. Search for **Header Search Paths**, and then add the path to the root of your app project.
4. (Optional) If you're using Swift, search for **Objective-C Bridging Header**, and then set its value to the path of the bridging header that you created in [Step 6](#step-6-optional-create-a-swift-bridging-header).

<a id="next-step"></a>
## Next step

After you set up the SDK, you need to [configure the processing terminal](/guides/payments/tap-to-pay-on-iphone/configure-the-processing-terminal).
