-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMGStoreKit.h
36 lines (26 loc) · 932 Bytes
/
MGStoreKit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// MGStoreKit.h
//
// Created by Matt Greenfield on 7/08/11.
// Copyright Big Paua 2012. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
typedef void (^ProductsCallback)(NSArray *products);
typedef void (^PurchaseCallback)(NSString *productId);
@interface MGStoreKit : NSObject
<SKProductsRequestDelegate, SKPaymentTransactionObserver>
+ (MGStoreKit *)store;
// fetch products data
- (void)requestProductsData:(NSSet *)products
callback:(ProductsCallback)callback;
// confirm permission before making a purchase
- (BOOL)canMakePayments;
// start the purchase
- (void)purchaseProduct:(NSString *)productId
success:(PurchaseCallback)callback
failed:(PurchaseCallback)failed;
// restore previous purchases
- (void)restore:(ProductsCallback)callback;
@property (nonatomic, retain) NSMutableDictionary *cachedProducts;
@end