I've adapted the play_billing
sample in the Google extras of the Android SDK to use my own app package name and public key. I was able to purchase a managed item as well as a subscription thru the app.
However, when I call methods such as Inventory.getAllPurchases()
the subscription is not returned in the user's inventory, even after restarting and reinstalling the app.
@Override
public void onQueryInventoryFinished(IabResult result, Inventory inventory)
{
if(result.isFailure())
{
log.error("In-app billing inventory query failed: " + result);
return;
}
for(Purchase purchase : inventory.getAllPurchases())
{
log.info("Purchase: " + purchase.getSku());
}
}
Output:
Purchase: premium
The regular, single-time purchase (premium
) is output as you can see, but the subscription purchase (paid_app
) is not. When I try to buy the subscription again it says I've already bought it:
I've tried everything I know, but I can't figure this out. Since the regular item is working as intended, I don't see why the subscription isn't being returned unless I'm totally off base on how that is supposed to work.
I have the APK uploaded as a draft. I have my email address on the phone in the testers list; the email is NOT my developer email. My subscription item is Active. The phone I'm testing on has the latest version of Google Play.
Edit: Still no luck. However, here's another update in case it's relevant. When I go into Google Wallet none of the transactions show up (ostensibly because they are test transactions). And for my test user account when I go into Google Play under subscriptions, it is not listed. Yet it won't let me purchase again. So not only do the purchased subscriptions not show up when I query for them, but they also are nowhere I can cancel to test again.
Any ideas here would be greatly appreciated.