voidonEconomyStoreGet(constHiro::EconomyList&economyList){for(autoit=economyList.storeItems.begin();it!=economyList.storeItems.end();it++){std::cout<<"Found store item: "<<it->name<<'\n';}}voidonError(constNakama::NError&error){std::cout<<Nakama::toString(error.code)<<": "<<error.message<<'\n';}Hiro::EconomyListRequestrequest;request.storeType=Hiro::EconomyStoreType::ECONOMY_STORE_TYPE_APPLE_APPSTORE;hiroClient->economyStoreGet(session,request,onEconomyStoreGet,onError);
Send a marker of intent to purchase by the player.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
voidonPurchaseIntentSuccess(){std::cout<<"Successfully sent purchase intent!\n";}voidonError(constNakama::NError&error){std::cout<<Nakama::toString(error.code)<<": "<<error.message<<'\n';}Hiro::EconomyPurchaseIntentRequestrequest;request.itemId="item_1";request.storeType=Hiro::EconomyStoreType::ECONOMY_STORE_TYPE_APPLE_APPSTORE;request.sku="sku_1";hiroClient->economyPurchaseIntent(session,request,onPurchaseIntentSuccess,onError);
Get the current status on an Ad placement which may have been rewarded.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
voidonEconomyPlacementStatus(constHiro::EconomyPlacementStatus&economyPlacementStatus){std::cout<<"Found status for placement: "<<economyPlacementStatus.placementId<<"\n";}voidonError(constNakama::NError&error){std::cout<<Nakama::toString(error.code)<<": "<<error.message<<'\n';}Hiro::EconomyPlacementStatusRequestrequest;request.rewardId="reward_1";request.placementId="placement_1";request.count=0;hiroClient->economyPlacementStatus(session,request,onEconomyPlacementStatus,onError);
Webhook RPC to handle Rewarded Video Ad placement success callbacks.
1
2
3
4
5
6
7
8
9
10
11
voidonEconomyPlacementSuccess(){std::cout<<"Ad placement was successful!\n";}voidonError(constNakama::NError&error){std::cout<<Nakama::toString(error.code)<<": "<<error.message<<'\n';}hiroClient->economyPlacementSuccess(session,onEconomyPlacementSuccess,onError);