MacBuilder
2018-09-26 289cf06c44b9686d0422d3556e9bf5af7b694c19
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
//
//  IAPManager.h
//  IAPDemo
//
//  Created by Charles.Yao on 2016/10/31.
//  Copyright © 2016年 com.pico. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import "MRHttpResquest.h"
#import "MRFirsstHead.h"
 
typedef NS_ENUM(NSInteger, IAPFiledCode) {
    /**
     *  苹果返回错误信息
     */
    IAP_FILEDCOED_APPLECODE = 0,
    
    /**
     *  用户禁止应用内付费购买
     */
    IAP_FILEDCOED_NORIGHT = 1,
    
    /**
     *  商品为空
     */
    IAP_FILEDCOED_EMPTYGOODS = 2,
    /**
     *  无法获取产品信息,请重试
     */
    IAP_FILEDCOED_CANNOTGETINFORMATION = 3,
    /**
     *  购买失败,请重试
     */
    IAP_FILEDCOED_BUYFILED = 4,
    /**
     *  用户取消交易
     */
    IAP_FILEDCOED_USERCANCEL = 5
    
};
 
 
@protocol IApRequestResultsDelegate <NSObject>
 
- (void)filedWithErrorCode:(NSInteger)errorCode andError:(NSString *)error; //失败
 
@end
 
@interface IAPManager : NSObject
 
singleton_interface(IAPManager)
 
@property (nonatomic, weak)id<IApRequestResultsDelegate>delegate;
 
/**
 启动工具
 */
- (void)startManager;
 
/**
 结束工具
 */
- (void)stopManager;
 
/**
 请求商品列表
 */
- (void)requestProductWithId:(NSString *)productId;
 
 
@end