# NEED HELP!  In-app purchase always fails

**URL:** <https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [July 21, 2016, 7:27am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526 "2016-07-21T07:27:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_40a407b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_40a407b6](https://forums.unrealengine.com/u/anonymous_user_40a407b6)\
**Post date:** [July 21, 2016, 7:27am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/1 "2016-07-21T07:27:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pyr0t0n](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pyr0t0n](https://forums.unrealengine.com/u/pyr0t0n)\
**Post date:** [July 21, 2016, 10:32am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/2 "2016-07-21T10:32:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_40a407b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_40a407b6](https://forums.unrealengine.com/u/anonymous_user_40a407b6)\
**Post date:** [July 21, 2016, 4:36pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/3 "2016-07-21T16:36:58Z")

</div>

Yes, my app ID is already in the xml

---

<div class="post-metadata">

**Author:** ![RynerAJ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RynerAJ](https://forums.unrealengine.com/u/RynerAJ)\
**Post date:** [July 21, 2016, 5:47pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/4 "2016-07-21T17:47:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_40a407b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_40a407b6](https://forums.unrealengine.com/u/anonymous_user_40a407b6)\
**Post date:** [July 21, 2016, 6:27pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/5 "2016-07-21T18:27:57Z")

</div>

Yes, it is currently published in beta

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_40a407b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_40a407b6](https://forums.unrealengine.com/u/anonymous_user_40a407b6)\
**Post date:** [July 22, 2016, 6:48am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/6 "2016-07-22T06:48:02Z")

</div>

![f42fb81573bfc7da931f4de731b7c0c6fb58ba85.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/2/f42fb81573bfc7da931f4de731b7c0c6fb58ba85.jpeg) ![e852f0483805afca3d4cd338899807f817ca72d6.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/5/e852f0483805afca3d4cd338899807f817ca72d6.jpeg) ![a86d8901095435659949c6bcdba07c90aae416e4.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/6/a86d8901095435659949c6bcdba07c90aae416e4.jpeg) ![Code4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/2/329a859f4c888aa6af5ad52663977ecb157adbe8.jpeg)

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

---

<div class="post-metadata">

**Author:** ![Drenmon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/drenmon/32/561025_2.png) [@Drenmon](https://forums.unrealengine.com/u/Drenmon)\
**Post date:** [July 25, 2016, 10:54am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/7 "2016-07-25T10:54:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [July 25, 2016, 6:51pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/8 "2016-07-25T18:51:18Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Drenmon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/drenmon/32/561025_2.png) [@Drenmon](https://forums.unrealengine.com/u/Drenmon)\
**Post date:** [August 2, 2016, 5:18pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/9 "2016-08-02T17:18:13Z")

</div>

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

```auto

[OnlineSubsystem]
DefaultPlatformService=GooglePlay

[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=True

```

---

<div class="post-metadata">

**Author:** ![Distul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Distul](https://forums.unrealengine.com/u/Distul)\
**Post date:** [August 3, 2016, 6:14am UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/10 "2016-08-03T06:14:49Z")

</div>

> [@Drenmon;574668](#):
>
> I got mine working with this in my DefaultEngine.ini:
> 
> ```auto
> 
> [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.

---

<div class="post-metadata">

**Author:** ![Drenmon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/drenmon/32/561025_2.png) [@Drenmon](https://forums.unrealengine.com/u/Drenmon)\
**Post date:** [August 3, 2016, 12:54pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/11 "2016-08-03T12:54:46Z")

</div>

Update documentation.

> [@Distul;574986](#):
>
> 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.

It might help if it was written in the documentation, mainly [here](https://docs.unrealengine.com/latest/INT/Platforms/Android/InAppPurchases/).

You can’t forget what you don’t know 😉

---

<div class="post-metadata">

**Author:** ![Chris\_Babcock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Babcock](https://forums.unrealengine.com/u/Chris_Babcock)\
**Post date:** [August 3, 2016, 7:14pm UTC](https://forums.unrealengine.com/t/need-help-in-app-purchase-always-fails/69526/12 "2016-08-03T19:14:51Z")

</div>

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.
