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:
| 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. |
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
Step 1. Open the project
- From the Tap to Pay on iPhone SDK folder, go to the sample app folder in
iosSample/. - Open the
.xcodeprojfile in Xcode for the language that you want to use:- Swift:
iosSample/swiftSample/SwiftSample.xcodeproj - Objective-C:
iosSample/objectivecSample/CoreSDKExample.xcodeproj
- Swift:
- 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:
- For Development Team, select your Apple Developer team.
- For Bundle Identifier, enter a unique reverse-DNS identifier that is registered to your account, for example,
com.yourcompany.payroc-sample. - 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.
<string name="apiKey">YOUR_API_KEY</string>
Step 4. Run the app
- Connect your iPhone to your Mac with a cable, or pair it wirelessly.
- In Xcode, from the run destination picker, select your device.
- Select Run.
- When the app opens, go to the Settings tab.
- Enter your terminal ID, and then select Save.
- 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.