# "Read In App Purchase Information2" doesn't work without logging into Google Play Games

**URL:** <https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038>\
**Category:** Mobile\
**Tags:** subsystem, google-play-service, in-app-purchase, unreal-engine, Android, question\
**Created:** [November 17, 2021, 9:45pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038 "2021-11-17T21:45:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MonteChristov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MonteChristov](https://forums.unrealengine.com/u/MonteChristov)\
**Post date:** [November 17, 2021, 9:45pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/1 "2021-11-17T21:45:17Z")

</div>

Hi, I’m making an android game with in-game purchases. I’ve noticed that “Read In App Purchase Information2” only works when logged in to Google Play Games. I note that it’s about v2. Previously, v1 worked without this app. Is this normal for In-app purchases v2? Has anything changed? I’m working on UE 4.27.1.

![352414-screenshot.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/c/b1cd8063ea778a5412e13abc9bd023bd5ab635d3.png)

---

<div class="post-metadata">

**Author:** ![Beastman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beastman](https://forums.unrealengine.com/u/Beastman)\
**Post date:** [November 22, 2021, 8:30pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/2 "2021-11-22T20:30:18Z")

</div>

I’m currently working through these issues with 4.27.1 built from github code and will share what I have found. I will update as I make progress.

The code for this node checks for the validity of the unique net id. In my game the player is actually logged in with a valid response, and it still fails the IsValid() check. (problem with UE4 code? Not sure)

I noticed the google version of the query function call StoreInterface-\>QueryOffersById(…) doesn’t even use the ID. It may just be included for other platforms.

So I tested commenting the ID check out entirely, and the node worked. See UInAppPurchaseQueryCallbackProxy2::TriggerQuery in Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Private\InAppPurchaseQueryCallbackProxy2.cpp)

Obviously this isn’t a good solution and may have consequences Im not seeing yet. Also puzzled as to why the ID is invalid when the user is 100% logged in (in my case)

---

<div class="post-metadata">

**Author:** ![MonteChristov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MonteChristov](https://forums.unrealengine.com/u/MonteChristov)\
**Post date:** [November 27, 2021, 10:30pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/3 "2021-11-27T22:30:41Z")

</div>

Hi Beastman! Thanks for the answer. I would like to try your solution but I must admit that I am not very knowledgeable about C++. Could you give me a hint which part of the code exactly you excluded?

---

<div class="post-metadata">

**Author:** ![Beastman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Beastman](https://forums.unrealengine.com/u/Beastman)\
**Post date:** [November 28, 2021, 7:04pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/4 "2021-11-28T19:04:26Z")

</div>

You can see the commented out code here. Like I said, it’s not an ideal solution at all, and doesn’t consider other platforms. I still am not sure why even when logged in the ID was invalid here but since commenting out worked I didn’t investigate much further.

Also, note that you have to build the engine from github code to make a change like this. It’s not something you can do with the normal engine installed from the launcher.

 ![353209-codescreenshot.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/b/11ba3e137eab0928b4571b8625b9636572482804.png)

---

<div class="post-metadata">

**Author:** ![MonteChristov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MonteChristov](https://forums.unrealengine.com/u/MonteChristov)\
**Post date:** [November 28, 2021, 9:49pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/5 "2021-11-28T21:49:51Z")

</div>

Ok, thank you!

---

<div class="post-metadata">

**Author:** ![Guiges](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guiges](https://forums.unrealengine.com/u/Guiges)\
**Post date:** [July 3, 2023, 5:10pm UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/6 "2023-07-03T17:10:58Z")

</div>

In unreal engine 5.1 (maybe it’s the same with 4.27), we can fix this by changing GetUniqueNetIdFromCachedControllerId() at line 41 by GetUniqueNetIdForPlatformUser(), because … GetUniqueNetIdFromCachedControllerId is deprecated 🙂

---

<div class="post-metadata">

**Author:** ![avisidhu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@avisidhu](https://forums.unrealengine.com/u/avisidhu)\
**Post date:** [November 27, 2023, 9:06am UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/8 "2023-11-27T09:06:44Z")

</div>

This didn’t work for me on UE4.27 Source Code. Read In App Purchase Information2 still fails

---

<div class="post-metadata">

**Author:** ![avisidhu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@avisidhu](https://forums.unrealengine.com/u/avisidhu)\
**Post date:** [November 27, 2023, 9:07am UTC](https://forums.unrealengine.com/t/read-in-app-purchase-information2-doesnt-work-without-logging-into-google-play-games/491038/9 "2023-11-27T09:07:22Z")

</div>

The Engine doesn’t build after these changes (UE4.27 Source)
