Example Code
This collection of code examples is designed to provide you with practical, step-by-step instructions on how to seamlessly incorporate Trustly into your mobile applications, enhancing the user experience and streamlining your Open Banking processes. Happy coding! 🚀
Native Mobile Apps
For native mobile apps, Trustly recommends using the native Android and iOS SDKs. These example code bases demonstrate integrating the Trustly UI to enable mobile users to create authorized transactions for use with Trustly APIs. They can be used along side the getting started tutorials for Android and iOS.
Please note, these examples do not contain any backend or server-side functionality at this time.
iOS Example | Android Example |
---|---|
A simple SwiftUI iOS app using the Trustly iOS SDK to demonstrate a client-side integration for creating authorized transactions. | A simple Android app written in Kotlin and using the Trustly Android SDK to demonstrate a client-side integration for creating authorized transactions. |
See source code | See source code |
Web Apps and Mobile Webviews
Web apps and mobile apps which embed web content through webviews can use the Trustly Javascript library to integrate the Trustly UI. However, integrations of this nature must take additional care to address OAuth Bank user flows. See the OAuth guide for more details.
React Web App
A simple React web app using the Trustly Javascript library to demonstrate use of the Select Bank Widget and the Lightbox components of a Trustly UI integration.
Mobile Webviews
This codebase also includes examples of native iOS and Android apps using Webview components to render the above web app example in order to demonstrate a hybrid-platform application use case.
iOS Webview | Android Webview |
---|---|
SwiftUI iOS app that renders the linked React web app through a webview component. | Kotlin Android app that renders the linked React web app through a webview component. |
See source code | See source code |