Download

NEED HELP! In-app purchase always fails

I have gone through the Match 3 tutorial. I have tried several other setups regarding IAPs. My license key and product ids are all correctly inputted into the engine. Yet, I hit the button in my widget to make a purchase and nothing happens.

There were several nodes in the match 3 example that I could not find (get Online Account ID in the logging in section, save custom Int, etc). I have been trying different suggestions for the past three days, and ripping my hair out in the process. Can anyone help me with an example on how to set up IAPs in blueprints? I have two options set up in the google play developer console. Neither one functions when I press the button to purchase from within my store widget.

Do you have your Google APP ID in {PROJECT}\Build\Android\res\values\GooglePlayAppID.xml

That was the issue had, after put the App ID in the XML File all Google Services start working.

Yes, my app ID is already in the xml

Hi there, was wondering if your app already published in alpha/beta ?

Yes, it is currently published in beta

f42fb81573bfc7da931f4de731b7c0c6fb58ba85.jpege852f0483805afca3d4cd338899807f817ca72d6.jpega86d8901095435659949c6bcdba07c90aae416e4.jpegCode4.jpg

This is my latest attempt at the code. What am I doing wrong?

I’m having the same issue, another thing to check is that there is a second list of emails for testing purchases on the Developer Dashboard. Under Account Details -> License Testing.

ah I looked at your code a bit more.

I still wouldn’t login and then read your IAPs, what if they cancel out?

you pass reference to self into your purchase handler, this is on a callback thread, maybe its not valid in the callback, that would cause it to fail out… do you need to pass that?

you don’t handle your fail conditions, and the if statements that do nothing on a false scenario, log all of it somehow, i know its hard because you essentially can only test after you’ve deployed to the store. the on failure with the completion status might have your answer. have you published your in app products in the google play store?

in earlier builds of my game, i made a covert log screen that dumped out all this info, you had to press a special key combo to bring it up… it was a nightmare but once you get this sorted you can just forget about it (until you add payment validation, then welcome to the jungle baby)

I got mine working with this in my DefaultEngine.ini:



[OnlineSubsystem]
DefaultPlatformService=GooglePlay

[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=True

Literally every thread I see needing help on this is because of the forgotten INI entry. Think I’ll have to make a guide for the people.

Update documentation.

It might help if it was written in the documentation, mainly here.

You can’t forget what you don’t know :wink:

I’ve asked documentation team to update it. The Unreal Match3 example does this by having AndroidEngine.ini in the project’s Config/Android folder.