GADInAppPurchaseDelegate.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // GADInAppPurchaseDelegate.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2013 Google Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. @class GADDefaultInAppPurchase;
  9. @class GADInAppPurchase;
  10. #pragma mark - Default Purchase Flow
  11. /// In-app purchase delegate protocol for default purchase handling. The delegate must deliver
  12. /// the purchased item then call the GADDefaultInAppPurchase object's finishTransaction method.
  13. @protocol GADDefaultInAppPurchaseDelegate<NSObject>
  14. /// Called when the user successfully paid for a purchase. You must first deliver the purchased
  15. /// item to the user, then call defaultInAppPurchase's finishTransaction method.
  16. - (void)userDidPayForPurchase:(GADDefaultInAppPurchase *)defaultInAppPurchase;
  17. @optional
  18. /// Called when the user clicks on the buy button of an in-app purchase ad. Return YES if the
  19. /// default purchase flow should be started to purchase the item, otherwise return NO. If not
  20. /// implemented, defaults to YES.
  21. - (BOOL)shouldStartPurchaseForProductID:(NSString *)productID quantity:(NSInteger)quantity;
  22. @end
  23. #pragma mark - Custom Purchase Flow
  24. /// In-app purchase delegate protocol for custom purchase handling. The delegate must handle the
  25. /// product purchase flow then call the GADInAppPurchase object's reportPurchaseStatus: method.
  26. @protocol GADInAppPurchaseDelegate<NSObject>
  27. /// Called when the user clicks on the buy button of an in-app purchase ad. After the receiver
  28. /// handles the purchase, it must call the GADInAppPurchase object's reportPurchaseStatus: method.
  29. - (void)didReceiveInAppPurchase:(GADInAppPurchase *)purchase;
  30. @end