store.init on iOS question

From what I understand, calling store.init() on iOS will set store.isActive to true and also do some other magic in the background to get the store API ready to use.  

My question is - does store.init() call out to Apple’s servers somehow, or does everything happen locally on the device?

Also, is this call on iOS synchronous or asynchronous?  I’ve always called it, then waited a second or two before calling store.load().  I’m updating my store libs for Google Play and wanted to see how iOS compared.

Thanks,

Nate

Let me see if I can get information for you on this.  However I would suggest, that you continue to defer your store.loadProducts() call until closer to the time you need it. I doubt you need to present your pricing immediately. 

Rob

It is synchronous, but it is recommended not to tie your store.init() to loading IAPs. Once you set payment queue delegate (what store init does), it can receive previously uncompleted transactions. Like for when parents approve child’s purchase request. So you sometime would get callback called without initiating a purchase before hence. Apple recommends to init store as soon as it reasonable and you can somehow handle IAP.

I don’t know how to answer if it goes to apple servers. It is not something you should worry about, it isn’t asynchronous in that way if it is your question. All purchase stuff handled by device iTunes services, but they would contact Apple’s iTunes server to retrieve pending purchases and IAP details data.

Thanks guys for the help!  Makes sense.  For iOS I’ve set up the loadProducts call to be a bit delayed after init(), and for Google, the loadProducts call happens when the listener is called.  Seems to work well :slight_smile:

Let me see if I can get information for you on this.  However I would suggest, that you continue to defer your store.loadProducts() call until closer to the time you need it. I doubt you need to present your pricing immediately. 

Rob

It is synchronous, but it is recommended not to tie your store.init() to loading IAPs. Once you set payment queue delegate (what store init does), it can receive previously uncompleted transactions. Like for when parents approve child’s purchase request. So you sometime would get callback called without initiating a purchase before hence. Apple recommends to init store as soon as it reasonable and you can somehow handle IAP.

I don’t know how to answer if it goes to apple servers. It is not something you should worry about, it isn’t asynchronous in that way if it is your question. All purchase stuff handled by device iTunes services, but they would contact Apple’s iTunes server to retrieve pending purchases and IAP details data.

Thanks guys for the help!  Makes sense.  For iOS I’ve set up the loadProducts call to be a bit delayed after init(), and for Google, the loadProducts call happens when the listener is called.  Seems to work well :slight_smile: