InApp init method call

hi all,

simple, dumb question: the store.init method, I call it once at startup, and then I am fine? or do i need to call it again before restore, purchase etc?

…somehow the iAP is going nuts in my new game, worked fine that way in the other one :). [import]uid: 90610 topic_id: 30691 reply_id: 330691[/import]

@Dingo ,

I do not have the official answer but in my last app update (because of the Restore Purchase button) I did code calling the [lua]store.init()[/lua] as soon as needed, I mean: I call it the time that the user make a normal purchase and also call it again when the user is restoring purchases. So by now am calling it 2x and it is working as expected.

PS: BTW your question isn`t dumb one. 2 weeks ago when I was updating this app I told so I had the same question as you in mind but my “feeling” (or try and error) was that I should call the store any time I need it and so that has worked as I said but maybe we could call the store only one time (launch time for example - main.lua) and it does OK when running the app, who knows? :wink:
I hope that clarify something for you.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 30691 reply_id: 122976[/import]

hey rodrigo, thanks for your post!

i did call it before purchase, restore etc in my last app. but somehow i feel i only need to call it once…and the docs aren’t very clear about that or i am missunderstanding it :slight_smile:

[import]uid: 90610 topic_id: 30691 reply_id: 122982[/import]

Hey, guys, with my first game (using Director class that include module(…, package.seeall) function), I call store.init once in main.lua and nowhere else – and it seems to work fine. I have many screens where users can make purchases (and the options screen where users can restore), but I don’t store.init again in these modules.

I haven’t checked if things work differently with my new project where I use storyboard and no more module(…, package.seeall) function. That said, I don’t see why it would be any different…

Naomi [import]uid: 67217 topic_id: 30691 reply_id: 123010[/import]

hey naomi, thanks!

i am calling it only once, since this makes more sense to me. and it seems to work fine now, only strange thing is that alerts in my callback don’t show. but well, that probably has some other reason. [import]uid: 90610 topic_id: 30691 reply_id: 123013[/import]

@Dingo, @Naomi , thanks for the feedback.

So, as @Naomi said that calling it (store.init) only one time does work nice, and also you @Dingo, well, when I get to update my app again I`ll remove the 2nd call I make to store as looks like now that I do not need it.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 30691 reply_id: 123046[/import]

@Dingo ,

I do not have the official answer but in my last app update (because of the Restore Purchase button) I did code calling the [lua]store.init()[/lua] as soon as needed, I mean: I call it the time that the user make a normal purchase and also call it again when the user is restoring purchases. So by now am calling it 2x and it is working as expected.

PS: BTW your question isn`t dumb one. 2 weeks ago when I was updating this app I told so I had the same question as you in mind but my “feeling” (or try and error) was that I should call the store any time I need it and so that has worked as I said but maybe we could call the store only one time (launch time for example - main.lua) and it does OK when running the app, who knows? :wink:
I hope that clarify something for you.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 30691 reply_id: 122976[/import]

hey rodrigo, thanks for your post!

i did call it before purchase, restore etc in my last app. but somehow i feel i only need to call it once…and the docs aren’t very clear about that or i am missunderstanding it :slight_smile:

[import]uid: 90610 topic_id: 30691 reply_id: 122982[/import]

Hey, guys, with my first game (using Director class that include module(…, package.seeall) function), I call store.init once in main.lua and nowhere else – and it seems to work fine. I have many screens where users can make purchases (and the options screen where users can restore), but I don’t store.init again in these modules.

I haven’t checked if things work differently with my new project where I use storyboard and no more module(…, package.seeall) function. That said, I don’t see why it would be any different…

Naomi [import]uid: 67217 topic_id: 30691 reply_id: 123010[/import]

hey naomi, thanks!

i am calling it only once, since this makes more sense to me. and it seems to work fine now, only strange thing is that alerts in my callback don’t show. but well, that probably has some other reason. [import]uid: 90610 topic_id: 30691 reply_id: 123013[/import]

@Dingo, @Naomi , thanks for the feedback.

So, as @Naomi said that calling it (store.init) only one time does work nice, and also you @Dingo, well, when I get to update my app again I`ll remove the 2nd call I make to store as looks like now that I do not need it.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 30691 reply_id: 123046[/import]