0

I am using test Product Id (PRODUCT_ID = "1023608") to implement Nokia In-App purchase.

I can successfully purchase an Item using following code snippet.

mHelper.launchPurchaseFlow(this, PRODUCT_ID, RC_REQUEST, this, "");

I am getting succes response in onIabPurchaseFinished.

When I try to query recent purchases using mHelper.queryInventoryAsync(this); I am getting Owned items response: 0.

I was just wondering It should return me the product Id of purchased item.

Can anybody please help me If I am missing anything ?

Thanks :-)

Vipul
  • 27,808
  • 7
  • 60
  • 75

2 Answers2

1

Are you using emulator for testing: Then the known issues would state that "State of test IDs is not stored to back-end when emulator is used to initiate the purchase transactions."

Here's link to it: http://developer.nokia.com/community/wiki/Nokia_X_known_issues

Dr.Jukka
  • 2,346
  • 2
  • 15
  • 20
  • Jukka Sir I am testing it on Nokia X device. – Vipul Mar 24 '14 at 09:17
  • Ok, then I need to ping some help outside the site and see what goes on there. – Dr.Jukka Mar 24 '14 at 09:19
  • @Jukka I am using Test Id.Is this reason queryInventoryAsync doesn't show it as purchased ? 2nd point mentions that I guess in document. – Vipul Mar 24 '14 at 09:20
  • 1
    I asked help from NIAP expert, could indeed be the point, but then it should be made more clear in the documentation indeed. – Dr.Jukka Mar 24 '14 at 09:22
  • Jukka Thanks :-) I have also published one sample app on Nokia store with In App item.One it is approved I will test the app using actual product id. – Vipul Mar 24 '14 at 09:31
  • I got reply from an expert, and the issue is as you expected, also already added to docs, will then be available on next refresh – Dr.Jukka Mar 24 '14 at 10:02
1

You need to give productBundle as parameter to getPurchases-call. That Bundle should containt products related to your app:

ArrayList<String> products = new ArrayList<String>();
products.add("1023608");
products.add("1023609");
products.add("1023610");

Bundle queryBundle = new Bundle();
queryBundle.putStringArrayList("ITEM_ID_LIST", products);

Bundle ownedItems = mService.getPurchases(3, mContext.getPackageName(), ITEM_TYPE_INAPP, queryBundle, continueToken);

Note that test product ids are not working with getPurchases.

jtjk
  • 135
  • 5
  • Note that there is also alternative way to give those products by using setProductMappings-method. (see link: http://developer.nokia.com/resources/library/nokia-x/nokia-in-app-payment/nokia-in-app-payment-porting-guide.html). If you use that method, you should not give that queryBundle for getPurchases. – jtjk Mar 24 '14 at 11:11
  • +1 Thanks for the reply.I have done exactly same way you have shown above.What I am thinking currently is getPurchases might not work with test product Ids. – Vipul Mar 24 '14 at 11:47
  • 1
    That is correct. Test product Ids does not work with getPurchases. – jtjk Mar 24 '14 at 13:06