Android
Kotlin, Jetpack Compose or Views. Installed with Gradle.
iOS
Swift, SwiftUI or UIKit. Installed with Swift Package Manager.
How it works
- Your app calls
Tapipay.present(...)(or shows the SDK’sTapipayButton) with your user’s identifier and your company’s. - The SDK opens the TapiPay widget on a native screen, on top of your app.
- While the user pays or manages their autopay enrollments, the SDK delivers events to a callback.
- Your app closes the widget when it needs to, or the user closes it with the Close button or the back gesture.
Requirements
On both platforms you need:
- Your end user’s identifier (
identifier), the same one you send when you create the debt. - Your company alias (
organization) or your company code (companyCode). They work the same as in the web SDK: see Identify your company.
Android
1. Add the TapiPay repository
The SDK is distributed through a TapiPay Maven repository. Add it to your project’ssettings.gradle.kts:
settings.gradle.kts
2. Add the dependency
In your app module’sbuild.gradle.kts:
build.gradle.kts
The artifact is named
button for compatibility, but it contains the full SDK: the widget screen, the events and the optional button.AndroidManifest.xml: the SDK already declares the INTERNET permission and its own screen. You do not need ProGuard or R8 rules either: the SDK ships its own.
The SDK brings Jetpack Compose and Material 3 as dependencies. If your app uses Views (XML), you can still open the widget with Tapipay.present(); only TapipayButton requires Compose.
3. Open the widget
CallTapipay.present() from any Context (ideally an Activity):
present() throws IllegalArgumentException if the configuration is invalid: identifier is missing, you pass neither organization nor companyCode, or you use selectionStrategy with the autopay view.
The event callback is always invoked on the main thread.
4. Close the widget
The widget does not close by itself after a payment. Close it when you need to:dismiss() does not emit any event (you already know you closed it) and does nothing if no widget is open. You can call it from any thread.
Compose button (optional)
If your app uses Jetpack Compose,TapipayButton renders a Material 3 button that opens the widget when tapped:
MaterialTheme. If you pass onClick, the button does not open the widget and hands the tap to you.
TapipayConfig options
Events on Android
TapipayEvent is a sealed interface:
Appearance on Android
TapipayAppearance configures the native top bar that wraps the widget. If you pass nothing, it uses your MaterialTheme colors.
You can also redefine the default texts in your app with the
tapipay_button_text, tapipay_checkout_title, tapipay_checkout_close and tapipay_checkout_load_failed resources.
Android best practices
- One widget at a time. If you call
present()while a widget is already open (for example, on a double tap), the call is ignored. - Do not capture the
Activityin the callback. The SDK keeps the callback while the widget is open. Forward events to aViewModelor check theLifecyclebefore touching the UI. - Rotation and dark mode do not recreate the widget screen. If Android destroys the screen due to low memory, the widget reloads and the user has to fill in the form again.
iOS
1. Add the package
The SDK is distributed through Swift Package Manager from this repository:- Xcode
- Package.swift
- Open File → Add Package Dependencies…
- Paste the repository URL.
- Under Dependency Rule, choose Up to Next Minor Version from
0.1.0. - Add the
Tapipayproduct to your app target.
While the SDK is on
0.x versions, use Up to Next Minor Version (.upToNextMinor): you get fixes (0.1.x) without a 0.2.0 release changing your build unexpectedly. The SDK is only distributed through Swift Package Manager (no CocoaPods or Carthage).Info.plist.
2. Open the widget
Tapipay.present() presents the widget modally over the visible screen. Call it from the main thread:
from: parameter with your UIViewController.
3. Close the widget
The widget does not close by itself after a payment. Close it when you need to:dismiss() does not emit .closed (you already know you closed it) and does nothing if no widget is open.
SwiftUI button (optional)
TapipayButton is a SwiftUI button that opens the widget when tapped:
.failed event. If you pass onClick, the button does not open the widget and hands the tap to you.
TapipayConfig options on iOS
Events on iOS
Configuration errors
Tapipay.present() validates the configuration before opening the widget and throws a TapipayError:
Appearance on iOS
Autopay management
Withview = TapipayView.AUTOPAY (Android) or view: .autopay (iOS), the SDK mounts autopay management: your user sees their enrolled payment methods, enrolls a new one or removes an existing one.
- Android
- iOS
As on the web, autopay events only expose the payment method type, the last 4 digits and an opaque
id. Account holder data and full account or card numbers never travel.
Staging environment
Use staging while you build and test your integration, and remove the parameter (or use production) before you publish your app.After the payment
The widget does not close by itself when the user submits the payment: it shows a “payment submitted” screen and stays open until someone closes it.External links
The widget always opens inside your app. If the user taps a link to another site, it opens in the browser;tel:, mailto: or other app links open with the matching system app.
Coming soon
Two-way channel between your app and the SDK. We are building a two-way communication channel between your app and the SDK. It will bring new features to the TapiPay SDKs. We will let you know in What’s new when it is available.

