get purchased item detail at start of app with Iab

2019-05-10 08:44发布

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条回答
该账号已被封号
2楼-- · 2019-05-10 09:03

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 

    }
};
查看更多
登录 后发表回答