IAPDelegateImpl.cpp 801 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // IAPDelegateImpl.cpp
  3. // demo
  4. //
  5. // Created by Red_mini on 2024/10/30.
  6. //
  7. #include "IAPDelegateImpl.hpp"
  8. IAPDelegateImpl* IAPDelegateImpl::createWith(){
  9. IAPDelegateImpl* ret = new IAPDelegateImpl();
  10. return ret;
  11. }
  12. // 用户成功购买通知
  13. void IAPDelegateImpl::onUserBuySuccess(std::map<std::string, string> buyInfos){
  14. for(const auto& buyInfo : buyInfos){
  15. printf("道具名称: %s , 道具数量: %d\n", buyInfo.first.c_str(), stoi(buyInfo.second));
  16. }
  17. }
  18. // 获取失败时需要显示的卡片名称
  19. std::vector<std::string> IAPDelegateImpl::getCardsNameWhenFailed(){
  20. std::vector<std::string> names;
  21. // names.push_back("礼包1");
  22. names.push_back("tilefavor");
  23. names.push_back("tilepack");
  24. names.push_back("tilepass");
  25. return names;
  26. }