Skip to content

Instantly share code, notes, and snippets.

@abbas-oveissi
Created November 26, 2019 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abbas-oveissi/e91ba4d3a541b902669f73166446ea6c to your computer and use it in GitHub Desktop.
Save abbas-oveissi/e91ba4d3a541b902669f73166446ea6c to your computer and use it in GitHub Desktop.
private void isUserBuyFullVersion() {
if (!isCafeInstalled()) {
Toast.makeText(this, R.string.cafebazaar_isnot_installed_error, Toast.LENGTH_SHORT).show();
return;
}
mHelper.queryInventoryAsync(new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
if (result.isFailure()) {
Toast.makeText(DetailActivity.this, R.string.query_inventory_error, Toast.LENGTH_SHORT).show();
return;
}
if (inventory.hasPurchase(SKU_FULL_VERSION)) {
bookmarkMovie();
} else {
buyFullVersion();
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment