AwardPeerCurrency
Used to award Peer currency.
Service | Operation |
---|---|
virtualCurrency | AWARD_PEER_VC |
Method Parameters
Parameter | Description |
---|---|
vcId | Type of currency (Ex. ticket, tokens) |
vcAmount | Currency amount to be awarded |
peer | Name of the peer |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var vcId = "tokens";
var vcAmount = 1;
var peerCode = "gameloot";
var virtualCurrencyProxy = bridge.getVirtualCurrencyServiceProxy();
var postResult = virtualCurrencyProxy.awardPeerCurrency(vcId, vcAmount, peerCode);
if (postResult.status == 200) {
// Success!
}
{
"service": "virtualCurrency",
"operation": "AWARD_PEER_VC",
"data": {
"vcId": "coins",
"vcAmount": 1,
"peer": "gameloot"
}
}
JSON Response
{
"status" : 200,
"data" :
{
"currencyMap": {
"gems": {
"purchased": 0,
"balance": 0,
"consumed": 0,
"awarded": 0,
"revoked": 0
},
"gold": {
"purchased": 0,
"balance": 100,
"consumed": 0,
"awarded": 100,
"revoked": 0
}
}
}
}