# In-App Support

In-App integration supports two approaches: Chrome Custom Tabs (recommended) and WebView. Custom Tabs requires no WebView adapter and provides a better user experience, with higher priority than WebView.

Open the payment page in-app using Chrome Custom Tabs without importing the EnjoyPayViewConfiguration.java adapter. Custom Tabs renders pages in the Chrome engine, supporting autofill, password management, and shared cookies and authentication state with the app.

# Usage Instructions

steps

  1. Add dependency: Include the AndroidX Browser library in app/build.gradle

  2. Launch Custom Tabs: Create a CustomTabsIntent with the payment URL and launch it

# Example Code

// app/build.gradle
dependencies {
    implementation 'androidx.browser:browser:1.5.0'
}
// Load the payment url, which is returned by the order creation api
String url = "https://demo-pay.enjoypayment.com/transaction/xabcdefg";
CustomTabsIntent intent = new CustomTabsIntent.Builder()
        .build();
intent.launchUrl(MainActivity.this, Uri.parse(url));

# WebView

Use WebView to render the payment page within the app, supporting H5 page redirection to payment apps. If the user does not have the payment app installed, it falls back to web page payment or redirects to the app store.

# Usage Instructions

steps

  1. Import the code file: EnjoyPayViewConfiguration.java

  2. Create or get the object: android.webkit.WebView

  3. Initialize the WebView object: EnjoyPayViewConfiguration.init(...)

  4. Load the payment URL: webView.loadUrl("https://.....")

# Code

# Example Code

//Get WebView
WebView webView = this.findViewById(R.id.webView);
//Create WebView object
//webView = new WebView(this);
/**
 * Initialize WebView
 * @param webView built-in browser control
 * @param fixUaToBrowser Whether to remove the WebView logo (optimized for some channel experiences)
 * @param handler jump thread processing outside the app
 */
EnjoyPayViewConfiguration.init(webView, true, new EnjoyPayViewConfiguration.EnjoyOutJumpHandler() {
    @Override
    public void apply(Intent intent) {
        // Define the method to jump to the application, pay attention to avoid thread problems
        startActivity(intent);
    }
});
//Load the payment url, which is returned by the order creation api
webView.loadUrl("https://demo-pay.enjoypayment.com/transaction/xabcdefg");

# Code File

EnjoyPayViewConfiguration

Last Updated: 8/25/2026, 9:38:30 PM