Skip to main content

1.2.2 - External Payments Support (Japan)

· 3 min read
Hyo

KMP-IAP 1.2.2 is a patch release that adds support for Google Play Billing Library 8.3.0's External Payments API, enabling side-by-side choice billing for users in Japan.

What's New

External Payments Support (Android 8.3.0+)

Added support for Google Play's External Payments billing program, which presents users with a side-by-side choice between Google Play Billing and the developer's external payment option directly in the purchase flow.

Japan Only

The External Payments program is currently only available for users in Japan.

New APIs

  • InitConnectionConfig.enableBillingProgramAndroid - Enable a billing program during connection initialization
  • developerProvidedBillingListener: Flow<DeveloperProvidedBillingDetailsAndroid> - Listen for developer billing selection
  • BillingProgramAndroid.ExternalPayments - New billing program enum value

New Types

  • DeveloperBillingOptionParamsAndroid - Configure external payment in purchase flow
  • DeveloperBillingLaunchModeAndroid - How to launch the external payment link
  • DeveloperProvidedBillingDetailsAndroid - Contains externalTransactionToken when user selects developer billing

Usage Example

import io.github.hyochan.kmpiap.kmpIapInstance
import io.github.hyochan.kmpiap.openiap.*

// Enable External Payments during connection initialization
val config = InitConnectionConfig(
enableBillingProgramAndroid = BillingProgramAndroid.ExternalPayments
)
kmpIapInstance.initConnection(config)

// Listen for developer billing selection
scope.launch {
kmpIapInstance.developerProvidedBillingListener.collect { details ->
println("External Transaction Token: ${details.externalTransactionToken}")
// Report token to Google within 24 hours
}
}

// Request purchase with External Payments option
kmpIapInstance.requestPurchase {
android {
skus = listOf("premium_product")
developerBillingOption = DeveloperBillingOptionParamsAndroid(
billingProgram = BillingProgramAndroid.ExternalPayments,
launchMode = DeveloperBillingLaunchModeAndroid.LaunchInExternalBrowserOrApp,
linkUri = "https://your-site.com/checkout"
)
}
}

Key Differences from User Choice Billing

FeatureUser Choice BillingExternal Payments
Billing Library7.0+8.3.0+
AvailabilityEligible regionsJapan only
UISeparate dialogSide-by-side in purchase dialog
Token SourceuserChoiceBillingListenerdeveloperProvidedBillingListener

OpenIAP Dependency Updates

Updated to the latest OpenIAP versions:

  • openiap-apple: 1.3.8 (was 1.3.7)
  • openiap-google: 1.3.19 (was 1.3.15)
  • openiap-gql: 1.3.10 (was 1.3.8)

Installation

Gradle (Kotlin DSL)

// shared/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.hyochan:kmp-iap:1.2.2")
}
}
}

Version Catalog (libs.versions.toml)

[versions]
kmp-iap = "1.2.2"

[libraries]
kmp-iap = { module = "io.github.hyochan:kmp-iap", version.ref = "kmp-iap" }

CocoaPods

pod 'kmp-iap', '~> 1.2.2'

Documentation

References

Questions or feedback? Reach out via GitHub Issues.