Fixed IAB flow

This commit is contained in:
M66B 2019-06-02 07:57:29 +02:00
parent a54ca0247b
commit 75be113b33
1 changed files with 4 additions and 1 deletions

View File

@ -312,7 +312,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
//} //}
for (IBillingListener listener : listeners) for (IBillingListener listener : listeners)
if (purchased) if (purchased && purchase.isAcknowledged())
listener.onPurchased(purchase.getSku()); listener.onPurchased(purchase.getSku());
else else
listener.onPurchasePending(purchase.getSku()); listener.onPurchasePending(purchase.getSku());
@ -402,6 +402,9 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
if (result.getResponseCode() == BillingClient.BillingResponseCode.OK) { if (result.getResponseCode() == BillingClient.BillingResponseCode.OK) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivityBilling.this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivityBilling.this);
prefs.edit().putBoolean("pro", true).apply(); prefs.edit().putBoolean("pro", true).apply();
for (IBillingListener listener : listeners)
listener.onPurchased(purchase.getSku());
} }
} }
}); });