Jump to content
  • Advertisement
  • entries
    133
  • comments
    7
  • views
    4542

Important Google IAP Plugin Update

Sign in to follow this  
CoronaRob

992 views

Corona Labs’ engineering team has made an important update to the Google In-App Purchase plugin that you need to be aware of.

Starting with Corona daily build 2017.3105, the store.init() call for Google IAP is now asynchronous. This means that it will return immediately while it continues to initialize in the background. This change was made to help reduce the number of ANR or “Application Not Responding” messages being reported in the Google Play Console.

Basically, ANR reports can occur when Android senses that an app appears non-responsive — this may happen when performing synchronous network activity on a poor network connection. During testing, it’s hard to see store.init() taking any time because it normally completes in just milliseconds, but when users have slower connections, the time can increase dramatically and trigger an ANR report.

The solution

Because of this change, you should modify how your app uses the Google IAP plugin.

While many developers already delay the store.loadProducts() call until the user reaches a place where products are listed, some developers call store.loadProducts() immediately after calling store.init() (the first mandatory call to get things rolling).

Under this new model, you should wait until you receive an "init" callback indicating that Google IAP is completely initialized and ready to process requests (this applies to store.restore() as well).

The updated version of the plugin generates a new init event which is dispatched to the transaction listener specified within store.init(). This event has the unique event.name property with a value of "init" which you can use to differentiate it between storeTransaction events which must be handled by the same listener. Please see the documentation for an example of doing so.

Remember, these changes only affect Corona build 2017.3105 and later.


In addition to this update, we have fixed a Null Pointer Reference (NPR) error in the Amazon IAP plugin. This fix is available in all versions.


View the full article

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!