IAPRunTimeData.hpp 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // IAPRunTimeData.hpp
  3. // demo
  4. //
  5. // Created by Red_mini on 2024/10/25.
  6. //
  7. #ifndef IAPRunTimeData_hpp
  8. #define IAPRunTimeData_hpp
  9. #include <stdio.h>
  10. #include "IAPDefine.hpp"
  11. NS_IAPSHOP_BEGIN
  12. enum UserBuyType{
  13. NoShopping, // 无购买行为
  14. LittleShopping, // 仅购买特惠
  15. NormalShopping, // 正常消费
  16. LotShopping // 土豪
  17. };
  18. class IAPRunTimeData{
  19. public:
  20. static IAPRunTimeData* getInstance();
  21. IAPRunTimeData();
  22. void setDeviceLevel(int level);
  23. int getDeviceLevel();
  24. // 获取用户类型
  25. UserBuyType getUserBuyType();
  26. // 获取用户购买过的最贵礼包金额
  27. float getUserBuyMaxAmount();
  28. private:
  29. void _init();
  30. private:
  31. static IAPRunTimeData* _instance;
  32. int _leval;
  33. };
  34. NS_IAPSHOP_END
  35. #endif /* IAPRunTimeData_hpp */