I implemented inapp billing (subscriptions) and everything works properly - I am able to subscribe, I acknowledge subscription, and billing flow ends succesfully with OK status.
However, at start of my app I am performing check (from Google Play cache) whether I already made purchases - and I always get DEVELOPER_ERROR.
This is my code:
public void checkIfPurchased() {
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(BillingResult billingResult) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
Purchase.PurchasesResult alreadyPurchasedResult = billingClient.queryPurchases(SKU_ID);
List<Purchase> alreadyPurchased = alreadyPurchasedResult.getPurchasesList();
...
// alreadyPurchasedResult = 5 = DEVELOPER_ERROR
}
}
}
Why this happens?