// // IAPDelegateImpl.cpp // demo // // Created by Red_mini on 2024/10/30. // #include "IAPDelegateImpl.hpp" IAPDelegateImpl* IAPDelegateImpl::createWith(){ IAPDelegateImpl* ret = new IAPDelegateImpl(); return ret; } // 用户成功购买通知 void IAPDelegateImpl::onUserBuySuccess(std::map buyInfos){ for(const auto& buyInfo : buyInfos){ printf("道具名称: %s , 道具数量: %d\n", buyInfo.first.c_str(), stoi(buyInfo.second)); } } // 获取失败时需要显示的卡片名称 std::vector IAPDelegateImpl::getCardsNameWhenFailed(){ std::vector names; // names.push_back("礼包1"); names.push_back("tilefavor"); names.push_back("tilepack"); names.push_back("tilepass"); return names; }