Overview
Webhooks
- Webhooks
- Webhook Event Guide
- Webhook Payloads
API Usage & How-Tos
Overlay Checkout
Mobile Integration
Plugins & External Integrations
Mobile Integration
Android Integration
This guide will help you integrate the Dodo Payments API into your Android mobile applications.
Android Integration
Using Custom Tabs
Copy
// Add Chrome Custom Tabs dependency to build.gradle
implementation 'androidx.browser:browser:1.5.0'
// In your Activity
class PaymentActivity : AppCompatActivity() {
private var customTabsSession: CustomTabsSession? = null
private var customTabsClient: CustomTabsClient? = null
private var customTabsServiceConnection: CustomTabsServiceConnection? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Initialize Custom Tabs
customTabsServiceConnection = object : CustomTabsServiceConnection() {
override fun onCustomTabsServiceConnected(name: ComponentName, client: CustomTabsClient) {
customTabsClient = client
customTabsClient?.warmup(0L)
customTabsSession = customTabsClient?.newSession(object : CustomTabsCallback() {
override fun onNavigationEvent(navigationEvent: Int, extras: Bundle?) {
// Handle navigation events
}
})
}
override fun onServiceDisconnected(name: ComponentName) {
customTabsClient = null
}
}
CustomTabsClient.bindCustomTabsService(
this,
"com.android.chrome",
customTabsServiceConnection!!
)
// Launch payment link
val paymentLink = "https://checkout.dodopayments.com/buy/{productid}"
val customTabsIntent = CustomTabsIntent.Builder(customTabsSession)
.build()
customTabsIntent.launchUrl(this, Uri.parse(paymentLink))
}
}
On this page
Assistant
Responses are generated using AI and may contain mistakes.