国内WASDK Apple实现层
hank
2018-09-20 6bcaeef68770f79eb0b5e461cce6db571e050d7b
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  *
eb8068 54  *  @param waProductId 对应wa产品id
330f2f 55  *  @param product 对应苹果商品类
H 56  *  @param serverId服务器id
57  *  @param extInfo一些额外信息
58  */
eb8068 59 +(void)singlePurchaseWithWAProductId:(NSString *)waProductId product:(SKProduct*)product withServerId:(NSString*)serverId withExtInfo:(NSString*)extInfo;
330f2f 60 /**
H 61  *  单个商品购买
62  *
63  *  @param productId 对应苹果商品id
64  *  @param extInfo一些额外信息
65  */
66 +(void)payWithProductId:(NSString *)productId extInfo:(NSString *)extInfo delegate:(id<WAPaymentDelegate>)delegate;
67
68 +(void)fetchProductInformations:(NSDictionary *)waProducts inventoryDelegate:(id<WAInventoryDelegate>)delegate;
69
70 +(SKProduct*)getCurrentProduct;
71
72 +(NSData*)getCurrentReceipt;
73 @end