1
0

GADInAppPurchase.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // GADInAppPurchase.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2013 Google Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "GADModules.h"
  9. /// Enum of the different statuses resulting from processing a purchase.
  10. typedef NS_ENUM(NSInteger, GADInAppPurchaseStatus) {
  11. kGADInAppPurchaseStatusError = 0, ///< Error occured while processing the purchase.
  12. kGADInAppPurchaseStatusSuccessful = 1, ///< Purchase was completed successfully.
  13. kGADInAppPurchaseStatusCancel = 2, ///< Purchase was cancelled by the user.
  14. kGADInAppPurchaseStatusInvalidProduct = 3 ///< Error occured while looking up the product.
  15. };
  16. /// The in-app purchase item to be purchased with the purchase flow handled by you, the
  17. /// application developer.
  18. /// Instances of this class are created and passed to your in-app purchase delegate when users click
  19. /// a buy button. It is important to report the result of the purchase back to the SDK in order to
  20. /// track metrics about the transaction.
  21. @interface GADInAppPurchase : NSObject
  22. /// The in-app purchase product ID.
  23. @property(nonatomic, readonly, copy) NSString *productID;
  24. /// The product quantity.
  25. @property(nonatomic, readonly, assign) NSUInteger quantity;
  26. /// The in-app purchase delegate object must call this method after handling the in-app purchase for
  27. /// both successful and unsuccessful purchase attempts. This method reports ad conversion and
  28. /// purchase status information to Google.
  29. - (void)reportPurchaseStatus:(GADInAppPurchaseStatus)purchaseStatus;
  30. @end