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 / Would someone please mind checking my code?

Author
Message
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Mar 2017 04:44 Edited at: 28th Mar 2017 08:32
I'm getting my app repeatedly rejected by apple, saying that it won't allow purchases. The message always comes back the same. "Unable to complete purchase." In the Google Play version of the app, the IAP works just fine.

I have double, triple and quadrouple checked that my IAP reference names are listed correctly, and this, below is the code I'm using. Can someone please give it the yea or nay?

Firstly, when the app starts, I run this code:



Then, I have a function in my app for processing purchases. I pass in the index of the purchase which has been chosen by the player as an integer from 0 to 4. It uses this code:



It SEEMS that the inAppPurchaseActivate command seems to fail each time. But I could be wrong.
I work full-time making games in AGK2 and DBpro. Living the dream!
tmu
7
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 28th Mar 2017 13:04 Edited at: 28th Mar 2017 13:05
Your code generally seems fine to me. You seem to have omitted the Android part of setting the key but you don't report issues on Android so probably not your problem.

As we discussed before, I had the same issues. No reasonable error code whatsoever, just a dialog complaining about not being able to purchase. Even the device log showed no issues. I think my code was OK but I was missing the iTunes contract filing for it and so I got the error.

I found this a useful check list in having the same issue: https://www.raywenderlich.com/122144/in-app-purchase-tutorial

to summarize from that site (note: some words/terms are related to the site example):

-Does the project’s Bundle ID match the App ID from the iOS Development Center?
-Check Apple Developer System Status. Alternatively, try this link. If it doesn’t respond with a status value, then the iTunes sandbox may be down. The status codes are explained in Apple’s Validating Receipts With the App Store documentation.
-Have IAPs been enabled for the App ID? (Did you select “Cleared for Sale” earlier?)
-Is the full product ID being used when making an SKProductRequest? (Check the productIdentifiers property of RageProducts.)
-Have you waited several hours since adding your product to iTunes Connect? Product additions may be active immediately or may take some time.
-Is the Paid Applications Contract in effect on iTunes Connect?
-Have you tried deleting the app from your device and reinstalling?

I had not done the "paid applications contract" in itunes connect. After doing that and re-review, my app was approved and IAP worked. Your case may vary of course.
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Mar 2017 13:13 Edited at: 28th Mar 2017 13:16
Yep, just figured I'd check for occam's razor and see if my code itself is actually an issue

This does raise a couple of questions for me, though:

- Where can I set the bundle ID for my app in AppGameKit?
- Is the "full product ID" different to the text listed under "product ID" in iTunes Connect?
I work full-time making games in AGK2 and DBpro. Living the dream!
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th Mar 2017 15:38
Hey, tmu, I found that form! Fingers crossed that fixes it for me, too!
I work full-time making games in AGK2 and DBpro. Living the dream!

Login to post a reply

Server time is: 2024-04-20 13:11:56
Your offset time is: 2024-04-20 13:11:56