Some Google in-app billing v3 questions:
In my store code, I’m calling:
store.consumePurchase (products.productTable)
after initializing the store with a table structured as {product1, product2, product3} where each product is a string product identifier. The API seems to allow this:
store.consumePurchase( {"manangedItem1", "managedItem2"} )
Questions:
Is anyone else consuming items in a table rather than individually? I’m doing so upon store load to catch consumables that may not have been consumed in previous builds before proceeding with the normal store flow. Is there any reason not to do this? Consuming items individually one after another causes errors. But I suspect a Java crash I saw in a recent build is related to sending a table of items.
Is there a way to detect which products have already been purchased? I’m trying to do this to restore “No Ads” purchase if the app is uninstalled then reinstalled. I tried store.loadProducts but it just returns a list of products without any way to tell which may have previously been bought. I’ve managed to get it to work by detecting the specific error associated with buying an already bought product (see code below), but it would be better to know this in advance of hitting the transaction callback.
elseif tstate == "failed" then print("Transaction failed, type:", transaction.errorType) if system.getInfo( "targetAppStore" ) == "google" then if transaction.errorType == 7 and tryingToBuy == products.packFive then native.showAlert("You've already purchased No Ads.", "Ads will no longer be shown.", {"Okay"}) --print ("Restoring already owned noAds") end end ...