Skip to content

Instantly share code, notes, and snippets.

@abbas-oveissi
Created November 26, 2019 08:17
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/8314028c31a5e89e9b9ef3308eda2beb to your computer and use it in GitHub Desktop.
Save abbas-oveissi/8314028c31a5e89e9b9ef3308eda2beb to your computer and use it in GitHub Desktop.
private void isUserBuyStreaming() {
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_STREAMING)) {
openPlayer();
} else {
buyStreaming();
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment