For anyone interested, I used IAP Badger to get IAP purchases going and can confirm that promo codes work using the restore call (put it in main.lua). Tried it with the app installed and uninstalled and it works as expected.
Cheers,
Craig
For anyone interested, I used IAP Badger to get IAP purchases going and can confirm that promo codes work using the restore call (put it in main.lua). Tried it with the app installed and uninstalled and it works as expected.
Cheers,
Craig
Does IAP Badger cover the scenarios that Google says to cover? It sounds like getPurchases() is handled, but how about the PURCHASES_UPDATED listener?
https://developer.android.com/google/play/billing/billing_promotions.html#workflow
Can you explain this in more details? please!
Hi Pablo.
I just put the following code in my main.lua and it seemed to work fine. I set it to only work on Android because on iOS you are not supposed to do an automatic restore, but have a button to prompt the user. Im guessing the restore does something similar to the “getPurchases” supported by Android.
if onAndroid then iap.restore(false, restoreListener, restoreTimeout) end
Craig
Thank you very much Craig!
Be aware we made a change to the Google IAP plugin to make it asynchronous to reduce the number of ANR’s being reported. If you call store.restore() or store.loadProducts() immediately after calling store.init() it will likely fail since .init() is now running in the background. See:
https://coronalabs.com/blog/2017/07/19/important-google-iap-plugin-update/
Since Apple doesn’t want you restoring immediately, you’re probably already only calling store.restore() if you’re on Google based Android, so you can defer this action until your transaction listener gets an event with a state of “initialized”. If you’re doing the same for Amazon, you may need platform test the store.restore() since Amazon is still synchronous.
store.loadProducts() should be deferred until you’re closer to needing it.
Rob
Does IAP Badger cover the scenarios that Google says to cover? It sounds like getPurchases() is handled, but how about the PURCHASES_UPDATED listener?
https://developer.android.com/google/play/billing/billing_promotions.html#workflow