Set up your project
Do these steps once for each app. At the end, your app builds with the MoneiTapToPay package, locally and in CI.
Request the Apple entitlement
Tap to Pay on iPhone needs an entitlement from Apple for your developer team. MONEI does not give this entitlement. Request it from Apple with the Tap to Pay on iPhone entitlement request form. See the Tap to Pay on iPhone developer page for Apple's guidelines.
- Request the development entitlement for your team, for each app that takes payments. You need it before you can test on a device.
- Build and test your payment flow with it.
- Request the publishing entitlement. Apple asks for screenshots or a video of your payment flow.
Apple reviews each request. Plan for this review before your launch date.
Send your app details to MONEI
Send MONEI these details before you test on a device:
- Your Apple Team ID.
- The bundle ID of each app that takes payments.
App extensions that never take payments (for example a widget extension) do not need the entitlement, and you do not send their bundle IDs.
Add the package
The package is public. Swift Package Manager downloads the binaries from the release of each version. You do not need a GitHub account or a GitHub token.
- Xcode
- Package.swift
-
In Xcode, select File > Add Package Dependencies.
-
Enter the package URL:
https://github.com/MONEI/monei-tap-to-pay-ios -
Set the dependency rule to Exact Version and enter
0.1.1. -
Add the
MoneiTapToPayproduct to your app target.
dependencies: [
.package(url: "https://github.com/MONEI/monei-tap-to-pay-ios", exact: "0.1.1")
],
targets: [
.target(name: "YourApp", dependencies: [
.product(name: "MoneiTapToPay", package: "monei-tap-to-pay-ios")
])
]
Use an exact version for 0.x versions, because a 0.x minor version can change the API. From 1.0.0, use from:. See versions and compatibility.
Use 0.1.1 or later. Earlier versions download their binaries through the GitHub API, which needs GitHub authentication.
Configure your app target
Add the entitlement
Add this key to the .entitlements file of your app target:
<key>com.apple.developer.proximity-reader.payment.acceptance</key>
<true/>
Add the location usage description
The SDK needs the location of the device to accept payments. Add NSLocationWhenInUseUsageDescription to Info.plist:
<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to accept card payments with Tap to Pay on iPhone.</string>
Without this key, iOS does not ask the user for permission, and prepare and acceptPayment throw locationDenied at once.
Use the name "Tap to Pay on iPhone"
Use the name "Tap to Pay on iPhone" in your UI, as the Apple Human Interface Guidelines require.
Declare App Store privacy details
In App Store Connect, declare these data types. Declare all of them for app functionality, and not for tracking:
| Data type | Linked to the user |
|---|---|
| Coarse location | No |
| Precise location | No |
| Device ID | Yes |
Set up CI
Standard Swift Package Manager resolution works in CI. You do not need a secret.
Common questions
Package resolution fails. What do I check?
Check these items:
- The package URL is
https://github.com/MONEI/monei-tap-to-pay-ios. - The version is
0.1.1or later. Earlier versions need GitHub authentication.
Can MONEI request the Apple entitlement for me?
No. Apple gives the entitlement to your developer team, and your app uses it. Request it from Apple.