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/4eaa5d91bd94087b538216da59eea348 to your computer and use it in GitHub Desktop.
Save abbas-oveissi/4eaa5d91bd94087b538216da59eea348 to your computer and use it in GitHub Desktop.
private void buyDownload() {
if (!isCafeInstalled()) {
Toast.makeText(this, R.string.cafebazaar_isnot_installed_error, Toast.LENGTH_SHORT).show();
return;
}
mHelper.launchPurchaseFlow(this, SKU_DOWNLOAD, 1, new IabHelper.OnIabPurchaseFinishedListener() {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) {
if (result.isFailure()) {
Log.d(TAG, getResources().getString(R.string.purchasing_error) + result);
return;
} else if (info.getSku().equals(SKU_DOWNLOAD)) {
consumeDownloadPurchase(info);
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment