Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <Foundation/Foundation.h>
- #import <StoreKit/StoreKit.h>
- #import "MKStoreObserver.h"
- #import "MKStoreSetup.h"
- @protocol MKStoreKitDelegate <NSObject>
- @optional
- - (void)productFetchComplete;
- - (void)productPurchased:(NSString *)productId;
- - (void)transactionCanceled;
- // as a matter of UX, don't show a "User Canceled transaction" alert view here
- // use this only to "enable/disable your UI or hide your activity indicator view etc.,
- @end
- @interface MKStoreManager : NSObject<SKProductsRequestDelegate> {
- NSMutableDictionary* _catalog;
- NSMutableData* _catalog_data;
- NSMutableArray *_purchasableObjects;
- MKStoreObserver *_storeObserver;
- BOOL isProductsAvailable;
- }
- @property (nonatomic, retain) NSMutableDictionary* catalog;
- @property (nonatomic, retain) NSMutableArray *purchasableObjects;
- @property (nonatomic, retain) MKStoreObserver *storeObserver;
- // These are the methods you will be using in your app
- + (MKStoreManager*)sharedManager;
- // this is a static method, since it doesn't require the store manager to be initialized prior to calling
- + (BOOL) isFeaturePurchased:(NSString*) featureId;
- - (SKProduct*) getSKProductByID:(NSString*) featureId;
- // these three are not static methods, since you have to initialize the store with your product ids before calling this function
- - (void) buyFeature:(NSString*) featureId;
- - (NSMutableArray*) purchasableObjectsDescription;
- - (void) restorePreviousTransactions;
- - (BOOL) canConsumeProduct:(NSString*) productIdentifier quantity:(int) quantity;
- - (BOOL) consumeProduct:(NSString*) productIdentifier quantity:(int) quantity;
- //DELEGATES
- +(id)delegate;
- +(void)setDelegate:(id)newDelegate;
- @end
Advertisement
Add Comment
Please, Sign In to add comment