问题
I have implemented In-App in my application in that there is list of images with grid when user select image if user has already purchased that item it should never called again otherwise it should called method of
mHelper.launchPurchaseFlow(this, SKU_PREMIUM, RC_REQUEST,
mPurchaseFinishedListener, "");
i have successfully integrate in-app with my app and also item is being purchased but i want to know at start up if that item is purchased or not if not purchased than above code should be called otherwise it should allow to download that image
回答1:
Finally i found solution of how to get information of purchased item if it is already purchased or not
// subscriptions we own
IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result,
Inventory inventory) {
if (result.isFailure()) {
complain("Failed to query inventory: " + result);
return;
}
mIsPremium = inventory.hasPurchase(SKU_PREMIUM); ------> By here you can get information
}
};
来源:https://stackoverflow.com/questions/19658550/get-purchased-item-detail-at-start-of-app-with-iabhelper-android