国内WASDK Apple实现层
hank
2017-03-27 1dabae29ca667d92657ee499459584a55fe3da3b
commit | author | age
330f2f 1 //
H 2 //  GhwSdkIap.h
3 //  iOSInAppPurchases
4 //
5 //  Created by GHW-T-01 on 15/5/18.
6 //
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <WASdkIntf/WASdkIntf.h>
11
12 extern NSString * const IAPResultNotification;
13
14
15 @interface WAAPIapSingleton : NSObject
16 @property(nonatomic,weak)id<WAInventoryDelegate>inventoryDelegate;
17 @property(nonatomic,weak)id<WAPaymentDelegate>paymentDelegate;
18 @property(nonatomic,strong) NSArray* productIds;
19 @property(nonatomic,strong) NSMutableArray *products;
20 @property(nonatomic,strong) SKProduct* currentProduct;
21 @property(nonatomic,strong) NSData* currentReceipt;
22 @property(nonatomic,strong)NSMutableArray* productList;//存放SKProduct;
23 @property(nonatomic,strong)NSString* productId;
24 @property(nonatomic,strong)NSString* extInfo;
25 @property(nonatomic,assign)BOOL isPaying;
26 @property(nonatomic,strong)NSDictionary *waProducts;
27
28 /**
29  *  应用内支付初始化
30  *
31  */
32 +(void)init4Iap;
33
34 /**
35  *  清理商品内购相关变量
36  */
37 +(void)clean4Iap;
38
39 /**
40  *  获取单例
41  *
42  *  @return 返回单例
43  */
44 +(WAAPIapSingleton *)shareInstance;
45
46 ///**
47 // *  获取商品列表
48 // */
49 //+(void)queryInventory:(id<WAInventoryDelegate>)delegate;
50
51 /**
52  *  单个商品购买
53  *
54  *  @param product 对应苹果商品类
55  *  @param serverId服务器id
56  *  @param extInfo一些额外信息
57  */
58 +(void)singlePurchase:(SKProduct*)product withServerId:(NSString*)serverId withExtInfo:(NSString*)extInfo;
59 /**
60  *  单个商品购买
61  *
62  *  @param productId 对应苹果商品id
63  *  @param extInfo一些额外信息
64  */
65 +(void)payWithProductId:(NSString *)productId extInfo:(NSString *)extInfo delegate:(id<WAPaymentDelegate>)delegate;
66
67 +(void)fetchProductInformations:(NSDictionary *)waProducts inventoryDelegate:(id<WAInventoryDelegate>)delegate;
68
69 +(SKProduct*)getCurrentProduct;
70
71 +(NSData*)getCurrentReceipt;
72 @end