Created
November 26, 2019 08:17
-
-
Save abbas-oveissi/4eaa5d91bd94087b538216da59eea348 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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