12#import <Foundation/Foundation.h>
13#import <StoreKit/StoreKit.h>
19NS_ASSUME_NONNULL_BEGIN
24@protocol PurchaseManagerDelegate <NSObject>
31- (void)purchaseFailed:(NSString *)productID error:(NSError *)error;
33- (void)purchaseSucceeded:(NSString *)productID;
43@interface PurchaseManager : NSObject <SKPaymentTransactionObserver, SKRequestDelegate>
49@property(nonatomic, weak, nullable) id<PurchaseManagerDelegate>
delegate;
84- (BOOL)isPurchased:(nullable NSString *)productID;
91- (BOOL)isPending:(nullable NSString *)productID;
97- (void)beginConsumePurchase:(SKProduct *)product;
103- (void)beginPurchase:(SKProduct *)product;
114- (void)addProduct:(NSString *)productID;
122- (nullable NSDictionary *)createConsumeVerifyPostDictionary:(NSString *)sku
123 prices:(NSArray *)prices;
130- (nullable NSData *)createVerifyPostData:(NSArray *)products;
138- (nullable NSDictionary *)createVerifyPostDictionary:(NSArray *)products
139 productPrices:(nullable NSArray *)productPrices;
151- (void)paymentQueue:(SKPaymentQueue *)queue
152 restoreCompletedTransactionsFailedWithError:(NSError *)error;
158- (void)requestDidFinish:(SKRequest *)request;
186- (BOOL)checkConsumeItemID:(NSString *)itemID;
192- (void)alertSelect:(id)alert;
The StoreKit purchase and restore front end, shared across the store screens.
Definition PurchaseManager.h:43
void end()
Tears the purchase manager down.
Definition PurchaseManager.m:76
BOOL verifyPendingConsumeReceipt()
Verify any pending consumable receipt.
Definition PurchaseManager.m:789
void dealloc()
Tears down the manager and clears the delegate.
Definition PurchaseManager.m:835
PurchaseManager * sharedManager
The shared instance.
Definition PurchaseManager.m:41
void loadProductList()
Loads the product catalogue.
Definition PurchaseManager.m:343
instancetype init()
Builds the manager.
Definition PurchaseManager.m:52
void beginRestore()
Begin restoring completed transactions.
Definition PurchaseManager.m:136
void loadPendingConsumeList()
Load pending consumable receipts.
Definition PurchaseManager.m:734
void verifyConsumeReceipt()
Verify the consumable receipt.
Definition PurchaseManager.m:768
BOOL isPurchasable()
Whether the device can make payments.
Definition PurchaseManager.m:63
void savePendingConsumeList()
Save pending consumable receipts.
Definition PurchaseManager.m:708
void loadPendingList()
Loads purchases that were started but not finished.
Definition PurchaseManager.m:403
NSArray * pendingPackIDs
The packs whose purchase has not settled yet.
Definition PurchaseManager.m:296
void verifyReceipt()
Verify the receipt for the current verifingID/Price.
Definition PurchaseManager.m:253
NSArray * purchasedPackIDs
The packs the player has bought.
Definition PurchaseManager.m:276
void start()
Brings the purchase manager up.
Definition PurchaseManager.m:69
id< PurchaseManagerDelegate > delegate
The delegate.
Definition PurchaseManager.h:49
void restoreNothing()
A restore finished with nothing to restore.
void restoreSucceeded()
At least one restored product was verified.