KDIAPManager.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define ProductID_IAPp12 @"12yuanqian"
  10. #define ProductID_IAPp50 @"50yuan"
  11. #define ProductID_IAPp15 @"15day"
  12. #define ProductID_IAPp30 @"30day"
  13. #define ProductID_IAPp90 @"90day"
  14. #define ProductID_IAPp365 @"365day"
  15. NS_ASSUME_NONNULL_BEGIN
  16. typedef NS_ENUM(NSUInteger,IAPResultType) {
  17. IAPResultSuccess = 0, // 购买成功
  18. IAPResultFailed = 1, // 购买失败
  19. IAPResultCancle = 2, // 取消购买
  20. IAPResultVerFailed = 3, // 订单校验失败
  21. IAPResultVerSuccess = 4, // 订单校验成功
  22. IAPResultNotArrow = 5, // 不允许内购
  23. IAPResultIDError = 6, // 项目ID错误
  24. };
  25. typedef void(^IAPCompletionHandle)(IAPResultType type, NSData *data);
  26. @interface KDIAPManager : NSObject
  27. + (instancetype)shareIAPManager;
  28. /** 检测客户端与服务器漏单情况处理*/
  29. + (void)checkOrderStatus;
  30. /**
  31. 开启内购
  32. @param productID 内购项目的产品ID
  33. @param handle 内购的结果回调
  34. */
  35. - (void)startIAPWithOrderId:(NSString *)orderId productID:(NSString *)productID completeHandle: (IAPCompletionHandle)handle;
  36. @end
  37. NS_ASSUME_NONNULL_END