GetSalesInventoryByCategory
Method gets the active sales inventory for the passed-in currency type, platform, and category.
Valid platforms are:
- itunes
- appworld
- steam
- windows
- windowsPhone
- googlePlay
Service | Operation |
---|---|
product | GET_INVENTORY |
Method Parameters
Parameter | Description |
---|---|
platform | The store platform. |
userCurrency | The currency to retrieve the sales inventory for. This is only used for Steam and Facebook stores. |
category | The product category |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string platform = "googlePlay";
string userCurrency = "credits";
string category = "collectables";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.ProductService.GetSalesInventoryByCategory(platform, userCurrency, category, successCallback, failureCallback);
const char *platform = "googlePlay";
const char *userCurrency = "credits";
const char *category = "collectables";
_bc->getProductService()->getSalesInventoryByCategory(platform, userCurrency, category, this);
NSString *platform = @"googlePlay";
NSString *userCurrency = @"credits";
NSString *category = @"collectables";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc productService] getSalesInventoryByCategory:platform
userCurrency:userCurrency
category:category
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String platform = "googlePlay";
String userCurrency = "credits";
String category = "collectables";
this; // implements IServerCallback
_bc.getProductService().getSalesInventoryByCategory(platform, userCurrency, category, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var platform = "googlePlay";
var userCurrency = "credits";
var category = "collectables";
_bc.product.getSalesInventoryByCategory(platform, userCurrency, category, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
// N/A
var platform = "googlePlay";
var userCurrency = "credits";
var category = "collectables";
var productProxy = bridge.getProductServiceProxy();
var postResult = productProxy.getSalesInventoryByCategory(platform, userCurrency, category);
if (postResult.status == 200) {
// Success!
}
{
"service": "product",
"operation": "GET_INVENTORY",
"data": {
"platform": "googlePlay",
"user_currency": "credits",
"category": "collectables"
}
}
JSON Response
{
"status": 200,
"data": {
"product_inventory": [
{
"currency": {
"bar": 50
},
"description": "Bundle of 50 Bars.",
"fbUrl": "https://dev.braincloudservers.com/fbproductservice?gameId=eggies&itemId=barBundle2Imp",
"gameId": "eggies",
"imageUrl": "http://eggies6waves.braincloudservers.com/s3/eggies-prod/store/bars.png",
"itemId": "barBundle2Imp",
"priceData": {
"ids": [
{
"appId": "ipad",
"itunesId": "com.playbrains.eggiesdevhd2.barBundle2Imp"
},
{
"appId": "iphone",
"itunesId": "com.playbrains.eggiesdev2.barBundle2Imp"
}
]
},
"title": "Bars"
}
],
"server_time": 1395952561266
}
}