Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / restoring In app purchases

Author
Message
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 29th Jan 2013 19:16
Hello,
I have a quick question about restoring previously purchased in app purchases. Since this is a requirement by apple to have a restore button, what would the correct way of doing this be? I read somewhere that the command GetInAppPurchaseAvailable will do this.

However this command will return 0 if you are not logged in. The problem I am having is that you cannot "officially" log in with a test user account. so I have no way of knowing if it will work in the final release.

I know TGC has been using the in-app purchase commands, would it be possible if I could get a code snippet demonstrating a restore of previous purchases? Or is the way I am currently using ok?

the way I am using currently is ...




Thank you for your time
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jan 2013 21:39
Here's an actual function from Squashies World:



this.mess = abs(sin(times#))
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 29th Jan 2013 21:59 Edited at: 29th Jan 2013 22:03
Thank you very much for responding baxslash, did you include an actual restore button separate from the purchase button? I have a working purchase button that unlocks the content as expected but I read in the apple docs that you are required to have a way to just restore previous purchases. (in case of an uninstall of the app)

I have a similar method like yours in my app but if I have a fresh install getinapppurchaseavailable always reports 0 unless I go through the original process of buying it through in app purchase activate
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jan 2013 22:23
If a purchase has been successful on the current account it should show as being available using GetInAppPurchaseAvailable. I'm not sure what the problem is with it constantly showing 0...

A restore button would just check which IAP's are available and should not have to activate any purchases.

If you can replicate the issue please post it on the Google bug board: http://code.google.com/p/agk/issues/list


this.mess = abs(sin(times#))
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 29th Jan 2013 22:42
Thanks for your time, when I get a chance tonight I will use your exact function. If the problem persists I will post back here and on the bug report. I am using 1088 if it makes a difference. I don't know if it's a problem with apple test accounts but it's really strange hopefully its something I'm doing wrong as I have to submit this Friday
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 30th Jan 2013 03:42
Hey baxslash I thought I would give a quick update on my progress.
After testing and retesting and doing alot of research on google, I have come up with the conclusion that the IAP restore does not work in the sandbox mode for testing.

I can purchase content just fine. after I purchase it GetInAppPurchaseAvailable will report 1 and stay that way. If i delete the app and put it back on my device it reports 0 until I buy it again. It seems other people have had other similar issues with the sandbox environment. So I will submit as planned and see if apple flags it.

I appreciate the time you took to help me.

Login to post a reply

Server time is: 2024-05-06 16:19:05
Your offset time is: 2024-05-06 16:19:05