Question

I'm following instructions from documentations and developer blog, specifically this page: http://android-developers.blogspot.com/2012/12/in-app-billing-version-3.html

I'm trying to get list fo all availible in app purchases for my app and I just can't get the sample code:

Bundle bundle = mService.getSkuDetails(3, "com.example.myapp", 
        ITEM_TYPE_INAPP, skus); // skus is a Bundle with the list of SKUs to query
if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) {
    List detailsList = bundle.getStringArrayList(RESPONSE_SKU_DETAILS_LIST);
    for (String details : detailsList) {
        // details is a JSON string with 
        // SKU details (title, description, price, ...)
    }
}

Especially this part: // skus is a Bundle with the list of SKUs to query

Why would I provide list of skus, since I don't know what are they. I mean I just wanted to get all availible inn app purchases, how would I know their skus? Sure I can just check them in developer console but that's not the point of whole operation, right?

Can someone enlight it a bit for me?

Was it helpful?

Solution

There is no way to do this, at least I have not found a solution.

But all you need is a list of your SKUs to get all other useful information: price, title, description.

Just one thing to keep in mind and what drove me almost crazy, is that the list cannot be larger than 19. I did not see this number in any documentation but found it by trial and error, so I split the list in bundles of 19 and it works like a charm. I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top