In-App Purchase Problem - Buy Item not working
Hello there,
I would like to add In-App purchase to my game which is already published in App Store.
I have created the In-App purchase in Itunes Connect.
Used the exact ProductID in the purchase table and buy item function - did not go into expression editor while typing.
I request purchase data and it returns 1 when the buy actor is created.
Created the sandbox test account and sent my build to test via TestFlight. Signed out from app store while testing
However, the button does nothing when pressed after purchase data returns 1. My question is, do I have to do anything else in Itunes Connect ? My In-App purchase status is "Missing Metadata" at the moment, could this be the problem?
Thanks in advance
Best Answer
-
Armelline Posts: 5,364
Did you sign all the contacts on App Store Connect and enter your bank details and tax information?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Answers
It worked! Thanks a lot
Glad to have helped!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Hello! I hope it's cool if I bring back a two year old thread...Anyhow, I ran into a similar issue.
I'm unable to purchase my IAPs that I've set up on iOS. I followed GS's guidelines on setting up IAPs in your app. When I click to purchase, nothing happens.
I set up a "Please Wait" when the system's trying to purchase and it's supposed to disappear when the purchase is successful, but it's not going away.
Is there a way I can see what's happening at this stage? I guess I just don't know how the Buy Item behavior works (ie, does it automatically find the item ID in PurchaseTable or does it connect to the iOS store to do that?), so I'm having trouble debugging it.
My IAPs should be good to go in App Store Connect. They're currently "Waiting for Review". They were good to go before but because my app was rejected, I had to modify them to get them out of "Developer Attention Needed".
If triggering the Buy behaviour does nothing, same advice as to the person who started this thread. Check all your contracts are in place. That's the most common cause of totally non-functioning IAPs.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
If you have signed all your contracts, Maybe best to post a screenshot of your rules too. You need to ensure you are referencing your purchase ID as well as list that Purchase ID in the Purchase Table and also trigger the "Get Store Data" rule with a callback of 1 before you trigger the purchase behaviour.
Thank you, @Armelline and @gingagaming, for responding! I apologize. I should have started off the conversation with screenshots of my setup.
In App Purchase - Request Purchase Data
To begin with, per the GS guidelines, I added this behavior into an actor. When the player enters this IAP scene, this actor kicks off this behavior.
Debug at this step: I've confirmed that this behavior works. I set up a debug Display Text and the callback is 1.
Problem at this step: The localized Name and Price do not appear even though the State is "unpurchased" as expected.
In App Purchase - Buy Item
Secondly, I added this behavior into a second actor. This actor is a button that the player would click to (1) purchase the item if it has not been purchased and (2) select this particular item as their new background. The Name for this actor is the same as the Product ID so I just reference the name. I'm hoping that doesn't impact the flow?
Debug at this step: I set up a Buying game attribute (boolean) that gets kicked off when the player attempts to purchase an item and is false when the purchase is successful. When the Buying boolean is true, a "Please Wait" message appears. This message appears correctly when I click to purchase an item.
Problem at this step: The purchase doesn't seem to go through and the "Please Wait" message never disappears. Last night I sat at this stage for almost 10 minutes. It probably shouldn't take that long, but I wanted to be sure.
IAP Setup
Lastly, here are the set-ups for the IAPs in the App Store Connect page. They currently say "Waiting for Review". I'm not sure if that impacts testing in TestFlight. Otherwise, they match what I have in PurchaseTable.
You say the product ID match the ones in the purchase table (we have to assume you are correct as we can't see) but why are you using a self attribute to reference the product ID? This should EITHER
A: Link to the purchase Table at the correct Row and Column 1 (this ensure no mistakes are made and my preferred way too do this)
or
B: type the product ID in the field WITHOUT opening the expression editior (you must ensure it is typed correctly
When you trigger a purchase with the Buy behaviour, does it set the table cell col 5 for that item to "pending?"
It's been a long time since I actually did an IAP, did it ever actually support localised prices?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@gingagaming I tried a few different methods. I first tried just writing the Product ID in that behavior. That didn't work. Then I tried referencing the table value. That also didn't work. This third time was attempting to simplify the behavior to reference the name of the actor, which matches the Product ID. This also doesn't work.
@Armelline I have a debug actor to display the contents of that column. It only says "unpurchased" and never switches to "pending". I'm assuming this means something's not connecting to the App Store.
It not even changing to pending really sounds like an incorrect setup on the App Store Connect side. Double and triple check the following, all three lead to the situation you're describing:
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
SMH. This was it. I searched through the entire App Store Connect site, went through all of my code, came up with so many darn debugs...And it was because I did not complete my Paid Apps section. I did not realize this section even existed...or if I did, it was a long time ago...
Sorry for wasting your time, all. My issue was the same as the OP. I'll just shuffle on back to my cave now.
Glad you got it sorted out! Apple really should lock down the IAP section or something until the contracts are signed - its so obtuse that things just don't work with no explanation.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support