IAP problem after restart

Get help using Construct 2

Post » Mon Aug 22, 2016 4:29 pm

I'm using @cranberrygame IAP plugin, and everything works fine until I turn off the app and restart it, then it "forgets" the purchased items that has been bought.
I get a message that it wants me to log in to my apple account when I open the app, but I'm already logged in to it. (I'm using testflight beta testing). And even if I log in, the "Has product" still doesn't work.

I tried having "restore purchases" in start of layout and that works but I don't want the users to have to log in everytime they start the app, that shouldn't be neccessary and it looks suspicious maybe.
I have On start of layout - Add product ID's and request store listing
then I have
On request store listing succeeded/ has product and I unlock the things that are bought.
B
10
S
3
Posts: 62
Reputation: 774

Post » Mon Aug 22, 2016 10:39 pm

Haven't you kind of answered your own question there, "restore purchases" is used to restore the purchased items.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Mon Aug 22, 2016 11:03 pm

But from what I've read, that function is only for for example a restore button, which is used when the user has installed the app on another device for example. And that requires the user to write the password again to their app store. And that shouldn't need to be used in the beginning everytime it starts, you should only need to have request store listing in the beginning and then the "has product" should work. At least that's what I've read in all of the tutorials I've read about IAP in construct.

I wouln't want to log in on app store everytime I started an app, I would be annoyed and not use it I think.
But maybe I've misunderstood something, or need to add something else along with restore purchases?
B
10
S
3
Posts: 62
Reputation: 774

Post » Mon Aug 22, 2016 11:34 pm

Oh right you're in test mode, yeah all purchases will be forgotten when you restart.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Tue Aug 23, 2016 12:10 am

But I also actually sent the app to apple and they approved it, I put it on the app store for a while, and I had a friend try one of the IAPs, and it didn't remember then either :/
I really hoped that it was just a testing thing but it doesn't seem seem like it unfortunaly..
B
10
S
3
Posts: 62
Reputation: 774

Post » Tue Aug 23, 2016 10:28 am

@cranberrygame could you just confirm if I need to use restore purchases in the beginning and if so, could that be done without the popup message with the log in to come up?
Here's a screenshot of the code I'm using. I'm using the variables since I'm having request store listing again later and I only want this to be activated once.
Image
B
10
S
3
Posts: 62
Reputation: 774


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 40 guests