IAPUserData.hpp 713 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // IAPUserData.hpp
  3. // TileManor
  4. //
  5. // Created by 徐炼新 on 2024/9/30.
  6. //
  7. #ifndef IAPUserData_hpp
  8. #define IAPUserData_hpp
  9. #include <cocos2d.h>
  10. #include "IAPDefine.hpp"
  11. NS_IAP_BEGIN
  12. class IAPUserData {
  13. public:
  14. static IAPUserData* getInstance();
  15. void init();
  16. // 添加购买信息
  17. // 参数说明 : 商品id
  18. void addBuyInfo(std::string commodityID);
  19. // 获取用户购买记录
  20. std::vector<std::string> getBuyInfos();
  21. // 清除所有购买信息
  22. void clearBuyInfo();
  23. private:
  24. private:
  25. static IAPUserData* _instance;
  26. std::vector<std::string> _buyInfos; // 用户购买信息
  27. };
  28. NS_IAP_END
  29. #endif /* IAPUserData_hpp */