Android createBillingProgramReportingDetailsAndroid
Creates the reporting details and external transaction token used by a Google Play Billing Program. The exact timing depends on the program. For External Offer, create fresh details immediately before every external-link launch; do not create them after payment or cache them for reuse.
Wraps BillingClient.createBillingProgramReportingDetailsAsync(...) — returns the external transaction token used to report a Developer-Provided Billing transaction. The Billing Programs surface starts in Play Billing 8.2.0, while External Offer integration requires Play Billing 8.2.1+. The optional developer billing type parameter is available in OpenIAP Spec 2.1.0 and openiap-google 2.3.0 for Billing Choice, which requires Play Billing 9.1.0+. See the Google Play Billing reference.
Signature
// Returns BillingProgramReportingDetailsAndroid with externalTransactionToken
// Token must be reported to Google Play backend within 24 hours
// Throws OpenIapError.NotPrepared if billing client not ready
suspend fun createBillingProgramReportingDetails(
program: BillingProgramAndroid,
developerBillingType: DeveloperBillingTypeAndroid? = null
): BillingProgramReportingDetailsAndroidParameters#
program(required,BillingProgramAndroid) — Billing program identifier.developerBillingType(optional,DeveloperBillingTypeAndroid) — Billing Choice reporting destination. Use'in-app'for native in-app developer billing, or'external-link'when the developer billing option uses a link.
Returns#
Promise<BillingProgramReportingDetailsAndroid> — payload to report a Developer-Provided Billing transaction:
externalTransactionToken(string) — Token to send to Google's reporting API. Required for compliance.
Example
// External Offer: create immediately before each launch; never cache.
val details = openIapStore.createBillingProgramReportingDetails(
BillingProgramAndroid.ExternalOffer
)