JubeatPlus 3.9.11
Loading...
Searching...
No Matches
PurchaseManager.h
Go to the documentation of this file.
1
11
12#import <Foundation/Foundation.h>
13#import <StoreKit/StoreKit.h>
14
15@class SKPaymentQueue;
16@class SKProduct;
17@class SKRequest;
18
19NS_ASSUME_NONNULL_BEGIN
20
24@protocol PurchaseManagerDelegate <NSObject>
25@optional
31- (void)purchaseFailed:(NSString *)productID error:(NSError *)error;
33- (void)purchaseSucceeded:(NSString *)productID;
38@end
39
43@interface PurchaseManager : NSObject <SKPaymentTransactionObserver, SKRequestDelegate>
44
49@property(nonatomic, weak, nullable) id<PurchaseManagerDelegate> delegate;
50
55@property(class, nonatomic, readonly) PurchaseManager *sharedManager;
56
62- (instancetype)init;
63
69+ (BOOL)isPurchasable;
70
77- (void)start;
84- (BOOL)isPurchased:(nullable NSString *)productID;
91- (BOOL)isPending:(nullable NSString *)productID;
97- (void)beginConsumePurchase:(SKProduct *)product;
103- (void)beginPurchase:(SKProduct *)product;
108- (void)beginRestore;
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;
144- (void)verifyReceipt;
151- (void)paymentQueue:(SKPaymentQueue *)queue
152 restoreCompletedTransactionsFailedWithError:(NSError *)error;
158- (void)requestDidFinish:(SKRequest *)request;
186- (BOOL)checkConsumeItemID:(NSString *)itemID;
192- (void)alertSelect:(id)alert;
197- (void)dealloc;
202@property(nonatomic, readonly, nullable) NSArray *purchasedPackIDs;
203
208@property(nonatomic, readonly, nullable) NSArray *pendingPackIDs;
209
214- (void)loadProductList;
219- (void)loadPendingList;
226- (void)end;
227
228@end
229
230NS_ASSUME_NONNULL_END
231
232// code: language=Objective-C
233// kate: hl Objective-C;
234// vim: set ft=objc :
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.