Simple Beginner Question About In-App Purchases

Hi,

I had a question about in-app best practices.  In my app I have a pop-up storyboard for my “store” screen which is separate from the basic game play screen.  So if someone wants to buy something they will have to enter the store and then click on a product.

Here is my question:  Is it better to call store.init() only once someone has opened the store pop-up or is it better to call store.init() as soon as the application loads?

From what I understand, it’s best to call store.init() once at the launch of the app (in main.lua)

Naomi

From what I understand, it’s best to call store.init() once at the launch of the app (in main.lua)

Naomi

One reason to call store.init right away is to allow the store to complete any transactions that were interrupted if your app got terminated before the transaction could complete.  That way you can properly credit your user with what he bought.

Also, you may want to restore any non-consumables right away if your app got re-installed or the user has gone to another device.  At least that is how I understand it.  I’m working on my first IAP stuff right now so I’m trying to really get my head around it.

Are there any good tutorials about it?

I don’t know of there are tutorials out there that are not ours.  We have blog post/tutorials on using IAP for both iOS and Android.  They are older, but should still be accurate.

And a IAP guide is on our roadmap.

One reason to call store.init right away is to allow the store to complete any transactions that were interrupted if your app got terminated before the transaction could complete.  That way you can properly credit your user with what he bought.

Also, you may want to restore any non-consumables right away if your app got re-installed or the user has gone to another device.  At least that is how I understand it.  I’m working on my first IAP stuff right now so I’m trying to really get my head around it.

Are there any good tutorials about it?

I don’t know of there are tutorials out there that are not ours.  We have blog post/tutorials on using IAP for both iOS and Android.  They are older, but should still be accurate.

And a IAP guide is on our roadmap.