GoogleMobileAds Framework Reference

GADDefaultInAppPurchaseDelegate

protocol GADDefaultInAppPurchaseDelegate : NSObjectProtocol

In-app purchase delegate protocol for default purchase handling. The delegate must deliver the purchased item then call the GADDefaultInAppPurchase object’s finishTransaction method.

  • Called when the user successfully paid for a purchase. You must first deliver the purchased item to the user, then call defaultInAppPurchase’s finishTransaction method.

    Declaration

    Swift

    func userDidPay(for defaultInAppPurchase: GADDefaultInAppPurchase)
  • Called when the user clicks on the buy button of an in-app purchase ad. Return YES if the default purchase flow should be started to purchase the item, otherwise return NO. If not implemented, defaults to YES.

    Declaration

    Swift

    optional func shouldStartPurchase(forProductID productID: String, quantity: Int) -> Bool