android - Restore Transactions in Google In-app Version 3 -


i have app , working fine want implement restore transactions method in app. did not find method how can can call or define or make other method restore transaction in in-app version 3. searched on net did not find relevant sol or info.

you can restore transaction using getpurchases() api

bundle owneditems = mservice.getpurchases(3, mcontext.getpackagename(),                 itemtype, continuetoken);   arraylist myskus, mypurchases, mysignatures;  myskus = owneditems.getstringarraylist(response_inapp_item_list);  mypurchases = owneditems.getstringarraylist(response_inapp_purchase_data_list);  mysignatures = owneditems.getstringarraylist(response_inapp_purchase_signature_list); 

will list items own , corresponding data can use verify purchases.

while make call, sure

  1. use google id used make purchase.
  2. not use static product ids(android.test.purchased, android.test.refunded...). can use test-ids created under iab test account.
  3. use appropriate product type , package name of app.

Comments