I'm trying to test a trial subscription using Android billing v3. The app already have products on production but I'm trying to also add a subscription. Everything works fine when I buy the trial subs for the first time. Then I cancelled it (wait hours and days) and then when I try to buy it again there's an Android Dialog with the message: You already own this item. Both Google Play app and my server side app confirm that the subscription is cancelled.
The logcat window shows this output:
03-24 15:41:53.722: D/IabHelper(21333): Constructing buy intent for com.MYAPP.freetrial, item type: subs
03-24 15:41:53.732: D/Finsky(20292): [1056] InAppBillingUtils.pickAccount: com.MYAPP: Account determined from installer data - [UAHnZq8S3yArGc_6ew11RBHr0DE]
03-24 15:41:53.742: D/IabHelper(21333): Launching buy intent for com.MYAPP.freetrial. Request code: 10001
03-24 15:41:53.742: D/audio_hw_primary(181): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
03-24 15:41:53.742: D/ACDB-LOADER(181): ACDB -> send_afe_cal
03-24 15:41:53.742: I/ActivityManager(580): START u0 {cmp=com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity (has extras)} from pid -1
03-24 15:41:53.812: D/Finsky(20292): [1] CarrierParamsAction.createCarrierBillingParameters: Carrier billing config is null. Device is not targeted for DCB 2.
03-24 15:41:53.812: E/Finsky(20292): [1054] FileBasedKeyValueStore.delete: Attempt to delete 'params5wrD2REIodMwVQIkVi-biw' failed!
03-24 15:41:53.872: W/GLSUser(17314): GoogleAccountDataService.getToken()
03-24 15:41:53.882: I/ActivityManager(580): Displayed com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity: +99ms
I had to add to onQueryInventoryFinished BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED checked because the subs was recreated on the server side everytime I query the inventory:
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
// Log.d(TAG, "Query inventory finished.");
mHelper.flagEndAsync();
if (result.isFailure()) {
// complain("Failed to query inventory: " + result);
return;
}
// Log.d(TAG, "Query inventory was successful.");
if (result.getResponse() == IabHelper.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED) {
return;
}
consumePuchasedItems(inventory);
// Log.d(TAG, "Initial inventory query finished; enabling main UI.");
}
My app is signed with release certificate, the build code+version numbers are exactly the same than in Developer Console.
I'm using the latest code from http://code.google.com/p/marketbilling/ (14/12/2013)
I have already checked Android billing - error you own this item and other similar posts, but it is not working.
I would appreciate any suggestion.Any idea? I'm working on this for several days and still no solution. The subscription process seems to work well for the first time, I tried with different account. The problem arises when I cancel it and try to re-buy it.
Thanks!!!