# 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[​](#apple-entitlement "Direct link to 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](https://developer.apple.com/contact/request/tap-to-pay-on-iphone/). See the [Tap to Pay on iPhone](https://developer.apple.com/tap-to-pay/) developer page for Apple's guidelines.

1. Request the **development** entitlement for your team, for each app that takes payments. You need it before you can test on a device.
2. Build and test your payment flow with it.
3. 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[​](#app-details "Direct link to 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[​](#add-package "Direct link to 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

1. In Xcode, select **File > Add Package Dependencies**.

2. Enter the package URL:

   ```
   https://github.com/MONEI/monei-tap-to-pay-ios
   ```

3. Set the dependency rule to **Exact Version** and enter `0.2.0`.

4. Add the `MoneiTapToPay` product to your app target.

Package.swift

```
dependencies: [

  .package(url: "https://github.com/MONEI/monei-tap-to-pay-ios", exact: "0.2.0")

],

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](https://docs.monei.com/monei-pay/in-app-tap-to-pay/test-and-go-live.md#versions).

Use `0.1.1` or later. Earlier versions download their binaries through the GitHub API, which needs GitHub authentication.

## Configure your app target[​](#configure-target "Direct link to Configure your app target")

### Add the entitlement[​](#entitlement-key "Direct link to Add the entitlement")

Add this key to the `.entitlements` file of your app target:

YourApp.entitlements

```
<key>com.apple.developer.proximity-reader.payment.acceptance</key>

<true/>
```

### Add the location usage description[​](#location "Direct link to Add the location usage description")

The SDK needs the location of the device to accept payments. Add `NSLocationWhenInUseUsageDescription` to `Info.plist`:

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"[​](#naming "Direct link to 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[​](#privacy "Direct link to 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[​](#ci "Direct link to Set up CI")

Standard Swift Package Manager resolution works in CI. You do not need a secret.

## Common questions[​](#common-questions "Direct link to Common questions")

### Package resolution fails. What do I check?[​](#resolution-fails "Direct link to 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.1` or later. Earlier versions need GitHub authentication.

### Can MONEI request the Apple entitlement for me?[​](#entitlement-by-monei "Direct link to 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.
