In library Google Play Billing, could someone tell me what the handlePurchase(purchase)
part is for? What exactly does she do?
@Override void onPurchasesUpdated(@BillingResponse int responseCode,
List<Purchase> purchases) {
if (responseCode == BillingResponse.OK
&& purchases != null) {
for (Purchase purchase : purchases) {
handlePurchase(purchase);
}
} else if (responseCode == BillingResponse.USER_CANCELED) {
// Handle an error caused by a user canceling the purchase flow.
} else {
// Handle any other error codes.
} }
It is a mandatory function for the purchase process or, in fact, the purchase has already occurred and I could do anything (notify, open a warning window, consult purchase and etc.)?
What does this part mean?