consumePurchase could not work independently?

There are some unmanaged IAP in the APP.

But we got error message 'You already own this item. ’ with some of IAP due to some bad case.

Then we try to solve this issue:

Add a button linked with the function below

==========

function MobileStore:restore(product_id_str)

    self:InitStore()

    if self.store == nil then

        print(“store is nil”)

        return

    end

    if self.paymentMode == 1  then --google iap v3

        print("trying restore " … product_id_str)

        --self.store.consumePurchase( { product_id_str }, transactionCallback)

        timer.performWithDelay(10, function() self.store.consumePurchase( { product_id_str }, transactionCallback); end)

          

    end

end

========

        

We hope the user could click the button to resolve the problem, but the miracle didn’t happen.

Does anyone here has the experience for this?

Could consumePurchase be used independently or must used after the purchase?

Thanks in advance, guys.

What google says:

  1. Send a getPurchases request to query the owned in-app products for the user.
  2. If there are any consumable in-app products, consume the items by calling consumePurchase. This step is necessary because the application might have completed the purchase order for the consumable item, but stopped or got disconnected before the application had the chance to send a consumption request.
  3. Get a response code from Google Play indicating if the consumption completed successfully.
  4. If the consumption was successful, provision the product in your application.

What google says:

  1. Send a getPurchases request to query the owned in-app products for the user.
  2. If there are any consumable in-app products, consume the items by calling consumePurchase. This step is necessary because the application might have completed the purchase order for the consumable item, but stopped or got disconnected before the application had the chance to send a consumption request.
  3. Get a response code from Google Play indicating if the consumption completed successfully.
  4. If the consumption was successful, provision the product in your application.