Google Play Promo codes

I’m not seeing much in the way of documentation for promo codes for Google Play with the Google IAP Library.

Is it possible to create promo codes and have them be redeemable via a Corona App? Or is this solution from 2014 still the best way to do it? http://www.jasonschroeder.com/2014/05/20/in-app-purchase-promo-codes-for-corona-sdk/#more-145

Personally, I would not make a paid app (=no downloads and generally disappointment).  Go for freemium and monetise that way.

Sorry to be the bearer of bad news but unless you are backed by a big publisher or you have an amazing game that gets featured on the app stores you will get no downloads and no revenue.

Hey Thanks for the reply. A bit of misunderstanding here. Likely due to lack of info on my part.
Our app is free with in-app purchases. We’re having a launch party next month and would like to give out promo codes for some of the upgrades in the app. iOS seems to be relatively simple but I don’t see a well documented method for Android (via Corona). I know I can’t be the only one looking for this which is why I’m asking.

Have you tried in the Play console?  https://support.google.com/googleplay/android-developer/answer/6321495

Also I am interested to know what your launch party is?

Ok so I’ve seen that link before. It’s basically what I’m looking for. However, I’m looking for a solution to use those promo codes created in the Google Play console in a Corona Application.

In the link you provided, it is mentioned that the application upon launch must call the function getPurchases() however this function is not part of the google.iap.v3 library for Corona. The closest function is the restore() function and I’m not sure if that is the solution.

The launch party is a party where we will be celebrating the launch of our game. The purpose is mostly promotion but also to celebrate all the hard work that has gone into making this game over the last year. We have quite an event planned with a large crowd expected.

Hi,

Did you ever try the restore() function to see if it worked?

Thanks,

Craig

There are no specific API’s for promo codes in our Google IAP plugin. I’ll see if I can find out information if restore() calls getPurchases(), which I kind of suspect that it does. Has any one tried it?

Rob

Awesome Rob,  that would be much appreciated.

Thanks,

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

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

Personally, I would not make a paid app (=no downloads and generally disappointment).  Go for freemium and monetise that way.

Sorry to be the bearer of bad news but unless you are backed by a big publisher or you have an amazing game that gets featured on the app stores you will get no downloads and no revenue.

Hey Thanks for the reply. A bit of misunderstanding here. Likely due to lack of info on my part.
Our app is free with in-app purchases. We’re having a launch party next month and would like to give out promo codes for some of the upgrades in the app. iOS seems to be relatively simple but I don’t see a well documented method for Android (via Corona). I know I can’t be the only one looking for this which is why I’m asking.

Have you tried in the Play console?  https://support.google.com/googleplay/android-developer/answer/6321495

Also I am interested to know what your launch party is?

Ok so I’ve seen that link before. It’s basically what I’m looking for. However, I’m looking for a solution to use those promo codes created in the Google Play console in a Corona Application.

In the link you provided, it is mentioned that the application upon launch must call the function getPurchases() however this function is not part of the google.iap.v3 library for Corona. The closest function is the restore() function and I’m not sure if that is the solution.

The launch party is a party where we will be celebrating the launch of our game. The purpose is mostly promotion but also to celebrate all the hard work that has gone into making this game over the last year. We have quite an event planned with a large crowd expected.

Hi,

Did you ever try the restore() function to see if it worked?

Thanks,

Craig

There are no specific API’s for promo codes in our Google IAP plugin. I’ll see if I can find out information if restore() calls getPurchases(), which I kind of suspect that it does. Has any one tried it?

Rob

Awesome Rob,  that would be much appreciated.

Thanks,

Craig