get purchased item detail at start of app with IabHelper android

青春壹個敷衍的年華 提交于 2020-01-23 01:41:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!