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 / ios iap help "Unable to complete your purchase"

Author
Message
Lavaflyer
12
Years of Service
User Offline
Joined: 2nd Jul 2012
Location: Wisconsin, U.S.
Posted: 20th Dec 2013 19:51 Edited at: 20th Dec 2013 19:53
So I'm working on an update to my game Block Ooo that will add some in-app-purchases. I've never messed with iap's before and I'm having a few issues with testing.

This is the code that initializes the iap:


This is the code that runs when the user clicks the buy button:


I have a test iap created in iTunes Connect called net.parallelgames.blockooo.rainbow.bundle and a sandbox account for testing. I run the app through the player to my ios device and when i click the buy button it prompts you for your id and password like it should but then after I type in the id and password the iPod displays the message "Unable to complete your purchase. Please try again later." The most logical explanation is the getInAppPurchaseAvailable(nRainbowBundleIapId) must always be returning 0. Why isn't this working, any help is greatly appreciated.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 21st Dec 2013 02:07
You can't use the AppGameKit Player to test IAP, but instead must compile the app in Xcode as if building it to release.
Lavaflyer
12
Years of Service
User Offline
Joined: 2nd Jul 2012
Location: Wisconsin, U.S.
Posted: 21st Dec 2013 02:24
Ah, yes that makes sense. Thanks for the quick help.
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 23rd Dec 2013 18:47
Here's some further info:
If you want to test your IAP in iOS you will need to make a full build of the APP file and install it on a beta testing device that you have registered with your Provisioning Profiles/Certificates.
You will also need to create a test user account in your iTunes connect under "manage users" (I think).
Then you will need to log in to the App store with that user on the testing device. You'll then be able to see the purchase dialog in the app and is should say something like "sandbox" with it.
The Apple Developer guides detail most of this out and it is fairly straightforward... but it is still a big pain.

I just went through the process and will be monitoring this thread in case you need more help.

Lavaflyer
12
Years of Service
User Offline
Joined: 2nd Jul 2012
Location: Wisconsin, U.S.
Posted: 23rd Dec 2013 19:27 Edited at: 23rd Dec 2013 19:31
Ok, sounds good. I'm just about finished with my update and will soon be building the project in xcode. I was also planning on adding an admob ad banner. Does this work very similarly meaning you can't test it with the player?

edit: Nevermind, I just was testing admob through the player and it worked flawlessly.
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 23rd Dec 2013 19:30
AdMob banners should show. With the player and even in the iOS simulator from xcode.

Lavaflyer
12
Years of Service
User Offline
Joined: 2nd Jul 2012
Location: Wisconsin, U.S.
Posted: 23rd Dec 2013 20:19
Um, how do I work the restore purchase button in my program. Currently I'm using this code but the problem is getinapppurchasestate() does not work with the restore command. any suggestions?

Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 23rd Dec 2013 20:20
Someone else will have to answer that one, all of my products are consumable/unmanaged.

Login to post a reply

Server time is: 2024-11-24 23:22:53
Your offset time is: 2024-11-24 23:22:53