awaitPurchaseResult
Purchases storeProduct. On the Play Store, if storeProduct represents a subscription, upgrades from the subscription specified by oldProductId and chooses storeProduct's default SubscriptionOption.
The default SubscriptionOption logic:
Filters out offers with
"rc-ignore-offer"
tagUses SubscriptionOption WITH longest free trial or cheapest first phase
Falls back to use base plan
If storeProduct represents a non-subscription, oldProductId and replacementMode will be ignored.
Return
A Result containing SuccessfulPurchase if successful, and PurchasesTransactionException in case of a failure.
Parameters
The StoreProduct you wish to purchase.
Play Store only, ignored otherwise. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. See developer.android.com for more info.
Play Store only, ignored otherwise. If this purchase is an upgrade from another product, provide the previous product ID here.
Play Store only, ignored otherwise. The replacement mode to use when upgrading from another product. This field is ignored, unless oldProductId is non-null.
Purchases packageToPurchase. On the Play Store, if packageToPurchase represents a subscription, upgrades from the subscription specified by oldProductId and chooses the default SubscriptionOption from packageToPurchase.
The default SubscriptionOption logic:
Filters out offers with
"rc-ignore-offer"
tagUses SubscriptionOption WITH longest free trial or cheapest first phase
Falls back to use base plan
If packageToPurchase represents a non-subscription, oldProductId and replacementMode will be ignored.
Return
A Result containing SuccessfulPurchase if successful, and PurchasesTransactionException in case of a failure.
Parameters
The Package you wish to purchase.
Play Store only, ignored otherwise. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. See developer.android.com for more info.
Play Store only, ignored otherwise. If this purchase is an upgrade from another product, provide the previous product ID here.
Play Store only, ignored otherwise. The replacement mode to use when upgrading from another product. This field is ignored, unless oldProductId is non-null.
Play Store only. Purchases subscriptionOption.
Return
A Result containing SuccessfulPurchase if successful, and PurchasesTransactionException in case of a failure.
Parameters
The SubscriptionOption you wish to purchase.
Play Store only, ignored otherwise. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. See developer.android.com for more info.
Play Store only, ignored otherwise. If this purchase is an upgrade from another product, provide the previous product ID here.
Play Store only, ignored otherwise. The replacement mode to use when upgrading from another product. This field is ignored, unless oldProductId is non-null.
App Store only. Use this function if you are not using the Offerings system to purchase a StoreProduct with an applied PromotionalOffer. If you are using the Offerings system, use the overload with a Package parameter instead.
Return
A Result containing SuccessfulPurchase if successful, and PurchasesTransactionException in case of a failure.
Parameters
The StoreProduct you wish to purchase.
The PromotionalOffer to apply to this purchase. StoreTransaction and updated CustomerInfo.
See also
App Store only. Purchases packageToPurchase. Call this method when a user has decided to purchase a product with an applied discount. Only call this in direct response to user input. From here Purchases will handle the purchase with StoreKit.
Return
A Result containing SuccessfulPurchase if successful, and PurchasesTransactionException in case of a failure.
Parameters
The Package you wish to purchase.
The PromotionalOffer to apply to this purchase. StoreTransaction and updated CustomerInfo.