KDIAPManager.h 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // KDIAPManager.h
  3. // KDChat
  4. //
  5. // Created by JYJ on 2019/6/14.
  6. // Copyright © 2019 dcjf. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef NS_ENUM(NSUInteger,IAPResultType) {
  10. IAPResultSuccess = 0, // 购买成功
  11. IAPResultFailed = 1, // 购买失败
  12. IAPResultCancle = 2, // 取消购买
  13. IAPResultVerFailed = 3, // 订单校验失败
  14. IAPResultVerSuccess = 4, // 订单校验成功
  15. IAPResultNotArrow = 5, // 不允许内购
  16. IAPResultIDError = 6, // 项目ID错误
  17. };
  18. typedef void(^IAPCompletionHandle)(IAPResultType type, NSData *data);
  19. @interface KDIAPManager : NSObject
  20. + (instancetype)shareIAPManager;
  21. /** 检测客户端与服务器漏单情况处理*/
  22. + (void)checkOrderStatus;
  23. /**
  24. 开启内购
  25. @param productID 内购项目的产品ID
  26. @param handle 内购的结果回调
  27. */
  28. - (void)startIAPWithOrderId:(NSString *)orderId productID:(NSString *)productID completeHandle: (IAPCompletionHandle)handle;
  29. @end