# Run the sample apps

Run the Swift or Objective-C sample app from the Tap to Pay on iPhone SDK package by configuring signing, adding your API key, and setting your terminal ID.

**Prerequisites:** [Authentication](/api/authentication) · [Set up the SDK](/guides/payments/tap-to-pay-on-iphone/set-up-the-sdk)

We've created sample apps in Swift and Objective-C that you can use to see how our SDK works.

Each sample app has the following tabs:

| **Tab** | **Description** |
| --- | --- |
| **Sale** | Enter an amount and select **Process** to open the Tap to Pay reader. Hold a contactless card or an Apple Pay device near the iPhone to complete the transaction. |
| **Reporting** | Browse the transaction history for your terminal. Select a row to view the full details of a transaction. |
| **Settings** | Set the terminal ID. Your changes take effect after you select **Save** and reconnect. |

<a id="before-you-begin"></a>
## Before you begin

Make sure that you've downloaded the Tap to Pay on iPhone SDK and extracted the contents. For more information, go to [Download the SDK package](/guides/payments/tap-to-pay-on-iphone/set-up-the-sdk#step-1-download-the-sdk-package).

Make sure that you have the following:

- Xcode 15 or later.
- An iPhone XS or later that runs iOS 18 or later.
- An Apple Developer account that you've enrolled in the Apple Developer Program.
- An approved [Tap to Pay on iPhone entitlement](https://developer.apple.com/documentation/proximityreader/setting-up-the-entitlement-for-tap-to-pay-on-iphone).

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

1. [Open the project](#step-1-open-the-project).
2. [Configure signing](#step-2-configure-signing).
3. [Add your API key](#step-3-add-your-api-key).
4. [Run the app](#step-4-run-the-app).

<a id="step-1-open-the-project"></a>
## Step 1. Open the project

1. From the Tap to Pay on iPhone SDK folder, go to the sample app folder in `iosSample/`.
2. Open the `.xcodeproj` file in Xcode for the language that you want to use:- Swift: `iosSample/swiftSample/SwiftSample.xcodeproj`
   - Objective-C: `iosSample/objectivecSample/CoreSDKExample.xcodeproj`
3. In the **Project navigator**, select the project file, and then select the app target.

<a id="step-2-configure-signing"></a>
## Step 2. Configure signing

The package doesn't include signing configuration, so you must set your own team and bundle ID before you build.

**Important:** The provisioning profile for your bundle identifier must include the Tap to Pay on iPhone entitlement, `com.apple.developer.proximity-reader.payment.acceptance`. Add the entitlement to your App ID in the Apple Developer portal, and then generate your provisioning profile again.

In the target's **Signing & Capabilities** tab, complete the following steps:

1. For **Development Team**, select your Apple Developer team.
2. For **Bundle Identifier**, enter a unique reverse-DNS identifier that is registered to your account, for example, `com.yourcompany.payroc-sample`.
3. For **Signing Certificate**, select **Automatically manage signing**, or select a provisioning profile that includes the Tap to Pay on iPhone entitlement.

**Note:** If you use automatic signing, add an entitlements file to the target, and then enable **Tap to Pay on iPhone** in **Signing & Capabilities**. Xcode syncs the entitlement to your provisioning profile.

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

The `payconfig.xml` file in the project root contains the gateway URLs and your API key. The file in the package already has the environment URLs, but you must add your API key.

```xml
<string name="apiKey">YOUR_API_KEY</string>
```

<a id="step-4-run-the-app"></a>
## Step 4. Run the app

1. Connect your iPhone to your Mac with a cable, or pair it wirelessly.
2. In Xcode, from the run destination picker, select your device.
3. Select **Run**.
4. When the app opens, go to the **Settings** tab.
5. Enter your terminal ID, and then select **Save**.
6. After the app retrieves your terminal configuration, on the **Sale** tab, select the device icon to initialize the reader.

**Note:** The sample apps run in `TEST` mode. Test transactions don't process real payments and don't appear in your production reporting.
