In-app browsers

Present the Trustly Checkout

If you for any reason can not use any of the Trustly SDKs to render the Trustly Checkout in your native application it’s recommended to use a In-App Browser. Specifically, use SFSafariViewController on iOS and Chrome Custom Tabs on Android.

SFSafariViewController

  1. Import SafariServices to your ViewController.
import SafariServices
  1. Create and present an SFSafariViewController and pass your Trustly Checkout URL as parameter.
let safariViewController = SFSafariViewController(url: "<Trustly Checkout URL>", configuration: SFSafariViewController.Configuration())
present(safariViewController, animated: true, completion: nil)

Custom Chrome Tabs

  1. Add the following dependency to your app/build.gradle file:
dependencies {
    ...
    implementation "androidx.browser:browser:1.3.0"
}
  1. Create and launch a Custom Tab and pass in your Trustly Checkout URL as parameter.
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse("<Trustly Checkout URL>"));