国内WASDK Apple实现层
hank
2018-09-14 eb8068cf69a2aa0eeab459f73c5bc7d1770ebcd5
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
//  GhwSdkIap.h
//  iOSInAppPurchases
//
//  Created by GHW-T-01 on 15/5/18.
//
//
 
#import <Foundation/Foundation.h>
#import <WASdkIntf/WASdkIntf.h>
 
extern NSString * const IAPResultNotification;
 
 
@interface WAAPIapSingleton : NSObject
@property(nonatomic,weak)id<WAInventoryDelegate>inventoryDelegate;
@property(nonatomic,weak)id<WAPaymentDelegate>paymentDelegate;
@property(nonatomic,strong) NSArray* productIds;
@property(nonatomic,strong) NSMutableArray *products;
@property(nonatomic,strong) SKProduct* currentProduct;
@property(nonatomic,strong) NSData* currentReceipt;
@property(nonatomic,strong)NSMutableArray* productList;//存放SKProduct;
@property(nonatomic,strong)NSString* productId;
@property(nonatomic,strong)NSString* extInfo;
@property(nonatomic,assign)BOOL isPaying;
@property(nonatomic,strong)NSDictionary *waProducts;
 
/**
 *  应用内支付初始化
 *
 */
+(void)init4Iap;
 
/**
 *  清理商品内购相关变量
 */
+(void)clean4Iap;
 
/**
 *  获取单例
 *
 *  @return 返回单例
 */
+(WAAPIapSingleton *)shareInstance;
 
///**
// *  获取商品列表
// */
//+(void)queryInventory:(id<WAInventoryDelegate>)delegate;
 
/**
 *  单个商品购买
 *
 *  @param waProductId 对应wa产品id
 *  @param product 对应苹果商品类
 *  @param serverId服务器id
 *  @param extInfo一些额外信息
 */
+(void)singlePurchaseWithWAProductId:(NSString *)waProductId product:(SKProduct*)product withServerId:(NSString*)serverId withExtInfo:(NSString*)extInfo;
/**
 *  单个商品购买
 *
 *  @param productId 对应苹果商品id
 *  @param extInfo一些额外信息
 */
+(void)payWithProductId:(NSString *)productId extInfo:(NSString *)extInfo delegate:(id<WAPaymentDelegate>)delegate;
 
+(void)fetchProductInformations:(NSDictionary *)waProducts inventoryDelegate:(id<WAInventoryDelegate>)delegate;
 
+(SKProduct*)getCurrentProduct;
 
+(NSData*)getCurrentReceipt;
@end