Stay organized with collections
Save and categorize content based on your preferences.
GADDefaultInAppPurchase
classGADDefaultInAppPurchase:NSObject
The consumable in-app purchase item that has been purchased by the user. The purchase flow is
handled by the Google Mobile Ads SDK.
Instances of this class are created and passed to your in-app purchase delegate after the user
has successfully paid for a product. Your code must correctly deliver the product to the user
and then call the didCompletePurchase method to finish the transaction.
Enables the default consumable product in-app purchase flow handled by the Google Mobile Ads
SDK. The GADDefaultInAppPurchaseDelegate object is retained while the default purchase flow is
enabled. This method adds a SKPaymentTransactionObserver to the default SKPaymentQueue.
Call this method early in your application to handle unfinished transactions from previous
application sessions. For example, call this method in your application delegate’s
application:didFinishLaunchingWithOptions: method.
The purchased item’s completed payment transaction. Your application can use this property’s
data to save a permanent record of the completed payment. The default purchase flow will finish
the transaction on your behalf. Do not finish the transaction yourself.
The in-app purchase delegate object must first deliver the user’s item and then call this
method. Failure to call this method will result in duplicate purchase notifications.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-03-03 UTC."],[],[],null,["# GoogleMobileAds Framework Reference\n\nGADDefaultInAppPurchase\n=======================\n\n class GADDefaultInAppPurchase : NSObject\n\nThe consumable in-app purchase item that has been purchased by the user. The purchase flow is\nhandled by the Google Mobile Ads SDK.\nInstances of this class are created and passed to your in-app purchase delegate after the user\nhas successfully paid for a product. Your code must correctly deliver the product to the user\nand then call the didCompletePurchase method to finish the transaction.\n- `\n ``\n ``\n `\n\n ### [+enableDefaultPurchaseFlowWithDelegate:](#/c:objc(cs)GADDefaultInAppPurchase(cm)enableDefaultPurchaseFlowWithDelegate:)\n\n `\n ` \n Enables the default consumable product in-app purchase flow handled by the Google Mobile Ads\n SDK. The GADDefaultInAppPurchaseDelegate object is retained while the default purchase flow is\n enabled. This method adds a SKPaymentTransactionObserver to the default SKPaymentQueue.\n\n Call this method early in your application to handle unfinished transactions from previous\n application sessions. For example, call this method in your application delegate's\n application:didFinishLaunchingWithOptions: method.\n- `\n ``\n ``\n `\n\n ### [disableDefaultPurchaseFlow()](#/c:objc(cs)GADDefaultInAppPurchase(cm)disableDefaultPurchaseFlow)\n\n `\n ` \n Disables the default in-app purchase flow handled by the Google Mobile Ads SDK and releases the\n associated GADDefaultInAppPurchaseDelegate object. \n\n #### Declaration\n\n Swift \n\n class func disableDefaultPurchaseFlow()\n\n- `\n ``\n ``\n `\n\n ### [productID](#/c:objc(cs)GADDefaultInAppPurchase(py)productID)\n\n `\n ` \n The in-app purchase product ID. \n\n #### Declaration\n\n Swift \n\n var productID: String { get }\n\n- `\n ``\n ``\n `\n\n ### [quantity](#/c:objc(cs)GADDefaultInAppPurchase(py)quantity)\n\n `\n ` \n The product quantity. \n\n #### Declaration\n\n Swift \n\n var quantity: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [paymentTransaction](#/c:objc(cs)GADDefaultInAppPurchase(py)paymentTransaction)\n\n `\n ` \n The purchased item's completed payment transaction. Your application can use this property's\n data to save a permanent record of the completed payment. The default purchase flow will finish\n the transaction on your behalf. Do not finish the transaction yourself. \n\n #### Declaration\n\n Swift \n\n var paymentTransaction: SKPaymentTransaction { get }\n\n- `\n ``\n ``\n `\n\n ### [finishTransaction()](#/c:objc(cs)GADDefaultInAppPurchase(im)finishTransaction)\n\n `\n ` \n The in-app purchase delegate object must first deliver the user's item and then call this\n method. Failure to call this method will result in duplicate purchase notifications. \n\n #### Declaration\n\n Swift \n\n func finishTransaction()"]]