unlimit
unlimit

Reputation: 3752

SKU not available for in app purchase during testing

I am adding in-app-billing to one of my existing apps. To test this I created a draft app in google play, uploaded the new version of the apk with in-app-billing and added a product. I activated this product but I did not publish this new test app.

But while testing, on querying for the newly created SKU, the code can't find it. Will I have to publish my app for this to work? Am I doing something wrong here?

EDIT: I am using IABv3.

Upvotes: 1

Views: 1555

Answers (1)

unlimit
unlimit

Reputation: 3752

I found the problem. I was using the TrivialDrive sample. I was under the impression that the code will automatically find and load all the SKUs. But after going through the documentation once again I found that I needed the pass the SKUs as a parameter.

  ArrayList skuList = new ArrayList();
  skuList.add(Product.SKU);             

  Log.d(TAG, "Setup successful. Querying inventory.");
  //mHelper.queryInventoryAsync(mGotInventoryListener);
  mHelper.queryInventoryAsync(true, skuList, mGotInventoryListener);

Upvotes: 2

Related Questions