App-to-app redirects for iOS
Set up direct app-to-app redirects for payments with the iOS SDK.
When you integrate a payment solution for customers on an iOS device, you can use our mock bank app to test your integration in the sandbox environment. We recommend you thoroughly test your app in the sandbox environment before you go live.
The mock bank app imitates the payment flow a user would experience on mobile if the chosen bank supports app-to-app redirects. This means that you can test the user flow from your app, to a bank app to approve the payment, and back to your app.
You can also use the TrueLayer Test Redirect page in a webview in your sandbox iOS app.
The Test Redirect page enables you to test whether the redirect from your app to the following bank apps works: Barclays, Lloyds, Monzo, Crédit Mutuel, ABN Amro and AIB.
However, you cannot test the return redirect with the Test Redirect page, so we recommend you also use the mock bank app for testing.
The mock bank app supports all of the Payments API v3 sandbox providers you can use to test redirect authentication flows.
Access to the iOS mock bank app
The first step of testing with the iOS mock bank app is to contact us to request access and register your test device. When you contact us, you need to provide your UDID and some additional information.
Get your UDID
Your UDID is what identifies your iOS test device. We need to register this in order for you to test with the mock bank app (we can only register one iOS test device per company).
To get your UDID, you can use one of two methods.
To get your UDID using the Music app:
- Connect your iOS test device to your Mac.
- Launch the Music app.
- Select the name of your device from the sidebar.
- At the top of the window that displays, there are some numbers under the name of your device. Click them until you see UDID.
- Right-click on UDID and click Copy UDID.
To get your UDID using Xcode:
- Connect your iOS test device to your Mac.
- Click Window > Devices and Simulators from the menu bar.
- Click your iOS test device on the left of the sidebar.
- Click the Identifier and copy it.
Other information to provide
In addition to your UDID, you also need to provide the following information when you request access to the mock bank app:
- A location where we can share the IPA file that contains the app with you.
Many email services block this kind of file. - The Xcode version number your iOS engineer will use to build your app.
- An approximate date you expect to finish testing by.
After you contact us and provide your UDID amd this information, we aim to register your device, release an updated version of the app, and share it with you within two weeks. We will contact you if we need more information or encounter any problems.
Install the iOS mock bank app
Once you have the IPA file that contains the iOS mock bank app, you need to install it to start testing. To do this:
- Connect your test iOS device to your Mac with Xcode.
- In Xcode, select Window > Devices and Simulators.
- Click Devices on the left, then select your iOS test device.
If your iOS test device doesn't display, ensure you choose to trust your Mac when you connect your iOS test device.
You may also need to enable Developer Mode on your iPhone. You can find this in Settings > Privacy & Security > Developer Mode. - Drag your IPA file into the Apps section.
The app is now available on your iOS test device.
Test with the mock bank app
Once you have the mock bank app installed, testing your payment flow requires minimal integration.
To test your payments integration with the mock bank app:
- Create a payment in your app or website.
You can use the HPP, EPP, SDKs, or direct API integration for payment authorisation. - As part of the payment, provide a sandbox
provider_id
for the redirect flow to test.- If you use the
user_selected
provider selection method, you can choose one of the redirect mock providers from the list that displays. - If you use the
preselected
provider selection method, you need provide aprovider_id
for the redirect mock provider at payment creation.
- If you use the
- Because you selected a sandbox
provider_id
, your app redirects you to the mock bank app. Here you can execute or reject your payment.
A payment results screen displays. - Click the link (this is your
return_uri
) on the payment result screen to be redirected to your app.
If your integration is configured correctly, you are redirected to your app.
If your integration isn't set up correctly, or the APK isn't installed on your device correctly, your app redirects you to the mock bank website instead of the mock bank app in step 2.
Updated about 24 hours ago