Skip to content
payrocdevelopers

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 · 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:

TabDescription
SaleEnter 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.
ReportingBrowse the transaction history for your terminal. Select a row to view the full details of a transaction.
SettingsSet the terminal ID. Your changes take effect after you select Save and reconnect.

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.

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.

Integration steps

  1. Open the project.
  2. Configure signing.
  3. Add your API key.
  4. Run the app.

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.

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.

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>

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.

Browse guides

Search documentation

API reference169
Guides118
Knowledge38
legal1
Solutions32
Workflows74
↑↓highlight↵openView all search results

Menu

Theme

Sign out

Your saved plans remain in your organization. This browser’s private draft and account view will be cleared.

Talk to an engineer