jonjonson’s response helped me a lot. I think the tutorial needs to be updated to reflect this for single item purchase, otherwise, other users will encounter exact the same problem when they use table for the product ID in the purchase call.
We are updating the IAP guide to reflect Google Play IAP3. It should be available some time this week. I submitted the updates yesterday and it has to go through editing and get pushed. Perhaps we should go back and update the tutorial too, but IAP V2 is still valid.
Checking logcat after doing a loadProduct using Google Play IAP v3, in the “SkuDetails” table that is returned to the IabHelper, there are 2 information that I’d like to access in lua but haven’t found them in event callback, “price_amount_micros” and “price_currency_code”.
Is there way for me to get these information, or is it possible to expose them in future versions of the plugin ?
Theres a field in the transaction callback called originalJson. You can try reading that to see if it has the information you need.
For example it would look like:
local store = require("plugin.google.iap.v3") function transactionCallback( event ) local transaction = event.transaction print(transaction.originalJson) end store.init( transactionCallback ) store.restore()
I checked the originalJson returned after a transaction, but it doesn’t include information about price. The only information I found there was in relation to ids of the transaction (ids of the app and iap, purchase token, etc.). Thanks for the suggestion tough.
So, I’m guessing I can’t access this info for now ? Is this something that Corona could expose in future versions of the plugin ?
Hopefully soon, was a bit of a PITA. As far as I remember I overcame this by getting the product list and storing the prices from there along with the product identifier.
We can get the localized through the loadProducts, and are using on some apps. Although localized price are fine if you are using them only to display them to the user, we need to download the price of items to make internal analytics and use them to measure how much each user is spending.
We currently do this in iOS, and this information would allow us to do the same in Android. It should be a small enough change, seeing as this is already provided through the IabHelper class that Corona seems to be using. If this feature could be moved up the priority list it would help us a lot.
jonjonson’s response helped me a lot. I think the tutorial needs to be updated to reflect this for single item purchase, otherwise, other users will encounter exact the same problem when they use table for the product ID in the purchase call.
We are updating the IAP guide to reflect Google Play IAP3. It should be available some time this week. I submitted the updates yesterday and it has to go through editing and get pushed. Perhaps we should go back and update the tutorial too, but IAP V2 is still valid.
Checking logcat after doing a loadProduct using Google Play IAP v3, in the “SkuDetails” table that is returned to the IabHelper, there are 2 information that I’d like to access in lua but haven’t found them in event callback, “price_amount_micros” and “price_currency_code”.
Is there way for me to get these information, or is it possible to expose them in future versions of the plugin ?
Theres a field in the transaction callback called originalJson. You can try reading that to see if it has the information you need.
For example it would look like:
local store = require("plugin.google.iap.v3") function transactionCallback( event ) local transaction = event.transaction print(transaction.originalJson) end store.init( transactionCallback ) store.restore()
I checked the originalJson returned after a transaction, but it doesn’t include information about price. The only information I found there was in relation to ids of the transaction (ids of the app and iap, purchase token, etc.). Thanks for the suggestion tough.
So, I’m guessing I can’t access this info for now ? Is this something that Corona could expose in future versions of the plugin ?