You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.6 KiB
65 lines
1.6 KiB
4 years ago
|
//
|
||
|
// TFIAPManager.h
|
||
|
// TFReader
|
||
|
//
|
||
|
// Created by 谢腾飞 on 2020/12/10.
|
||
|
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <Foundation/Foundation.h>
|
||
|
#import <StoreKit/StoreKit.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
typedef NS_ENUM(NSInteger, TFIAPFiledCode) {
|
||
|
TFIAP_FILEDCOED_APPLECODE = 0, // 苹果返回错误信息
|
||
|
TFIAP_FILEDCOED_NORIGHT = 1, // 用户禁止应用内付费购买
|
||
|
TFIAP_FILEDCOED_EMPTYGOODS = 2, // 商品为空
|
||
|
TFIAP_FILEDCOED_CANNOTGETINFORMATION = 3, // 无法获取产品信息,请重试
|
||
|
TFIAP_FILEDCOED_BUYFILED = 4, // 购买失败,请重试
|
||
|
TFIAP_FILEDCOED_USERCANCEL = 5, // 用户取消交易
|
||
|
TFIAP_FILEDCOED_BUYING = 6, // 商品正在请求
|
||
|
TFIAP_FILEDCOED_NOTLOGGEDIN = 7 //
|
||
|
};
|
||
|
|
||
|
|
||
|
@protocol TFIAPManagerResultsDelegate <NSObject>
|
||
|
// 请求成功
|
||
|
- (void)requestSuccess;
|
||
|
// 请求失败
|
||
|
- (void)filedWithErrorCode:(NSInteger)errorCode andError:(NSString *)error;
|
||
|
@end
|
||
|
|
||
|
@interface TFIAPManager : NSObject
|
||
|
|
||
|
interface_singleton
|
||
|
|
||
|
// 作品id - 用于充值来源统计
|
||
|
@property (nonatomic ,assign) NSInteger production_id;
|
||
|
|
||
|
// 作品类型 - 用于充值来源统计
|
||
|
@property (nonatomic ,assign) TFProductionType productionType;
|
||
|
|
||
|
@property (nonatomic ,weak) id<TFIAPManagerResultsDelegate>delegate;
|
||
|
|
||
|
/**
|
||
|
启动工具
|
||
|
*/
|
||
|
- (void)startManager;
|
||
|
|
||
|
/**
|
||
|
结束工具
|
||
|
*/
|
||
|
- (void)stopManager;
|
||
|
|
||
|
/**
|
||
|
请求商品列表
|
||
|
*/
|
||
|
- (void)requestProductWithId:(NSString *)productId;
|
||
|
|
||
|
- (void)checkIAPFiles;
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|