Getting Started

Install the SDK, set up the native project and check device requirements.

Install

npm install @lemonway/terminal

npm (7 or later) and pnpm also install the native Tap to Pay module the SDK runs on. react and react-native must already be in your app.

🚧

Yarn or React Native CLI

Yarn does not install peer dependencies, and the React Native CLI only links native modules listed in your package.json. Add the peer dependencies of the SDK to your app, at the listed versions:

npm info @lemonway/terminal peerDependencies
📘

Expo Go is not supported

Tap to Pay needs native code. Use an Expo development build or the React Native CLI.


Configure the native project

Add the config plugin to app.json, then run npx expo prebuild.

{
  "expo": {
    "plugins": [
      [
        "@lemonway/terminal",
        {
          "locationWhenInUsePermission": "Location access is required to accept in-person payments.",
          "iosTapToPayEntitlement": true
        }
      ]
    ]
  }
}
OptionDefaultDescription
locationWhenInUsePermissionLocation access is required to accept in-person payments.Text of the iOS location permission prompt.
iosTapToPayEntitlementtrueAdds the iOS Tap to Pay entitlement. Set it to false until Apple has enabled Tap to Pay on your App ID, or iOS signing fails.

The plugin:

  • adds the location permission and the Android permissions,
  • sets Android minSdkVersion to 26 (it never lowers a higher value),
  • adds the Tap to Pay process guard to MainApplication,
  • adds the iOS Tap to Pay entitlement.

Device requirements

Tap to Pay runs on a physical phone only, never on an emulator or simulator.

  • iPhone XS or later, on the latest iOS version (not a beta).
  • Apple's Tap to Pay on iPhone entitlement for your bundle identifier. Apple first grants a development entitlement; TestFlight and App Store releases need the distribution entitlement.
  • On the first connection, a merchant admin accepts Apple's Tap to Pay terms with their Apple ID.
  • Apple requires the app to explain Tap to Pay to merchants: follow Apple's Human Interface Guidelines for Tap to Pay on iPhone.
📘

Permissions

On Android, <LemonwayTerminalRoot> asks for the location (and Bluetooth) permissions when it mounts. Mount it on the screen where the merchant expects that prompt.


Did this page help you?