TrueLayer's iOS SDK allows you to quickly add open banking payments to your app. The SDK integrates with TrueLayer's Payments API, making it simple to get up and running.
The SDK presents native screens that allow your users to select their bank and consent to the payment. The user is then redirected to their banking app or website to authorise the payment. It also handles the network requests and errors, and gives you options to customise the user interface.
The Android version of the SDK can be found here.
Note: If you are migrating from the beta version of the iOS SDK, checkout this Migration Guide.
To install the SDK using Swift Package Manager:
- Open your app in Xcode.
- In the Project Navigator, click on the project.
- Click File > Add Packages...
- Insert the
https://github.com/truelayer/truelayer-ios-sdk
URL in the search bar and click Enter. - Click on the Add Package button.
- Follow the dialog to install the SDK.
To install the SDK via Cocoapods, specify TrueLayerPaymentsSDK
in your Podfile:
pod 'TrueLayerPaymentsSDK'
-
Create an account in the TrueLayer console. Follow this guide to set it up correctly.
-
You need a backend which is able to retrieve an access token and create a payment on behalf of the user. This is to enforce security on the client, avoiding the need to store static secrets in your app. The API documentation can be found here.
Finally, your app should setup a payment. Once the payment has been setup, it is possible to delegate all the remaining parts of the process to the SDK. To set up a payment, the backend should:
- Authenticate with TrueLayer.
- Create a Payment.
- Return the payment identifier and the resource token to the app.
The iOS SDK has the following requirements:
- Xcode 14.x
- Swift 5.9
- iOS 14.0
-
Import the SDK:
import TrueLayerSDK
-
Configure the SDK with the given environment:
Task { TrueLayer.Payments.manager.configure(environment: .sandbox) }
-
Checkout Documentation
You can style the SDK to match your app's UI. See Styling.