# IAP query not working - V2, Android (ue5.1)

**URL:** <https://forums.unrealengine.com/t/iap-query-not-working-v2-android-ue5-1/807149>\
**Category:** Mobile\
**Tags:** iap, unreal-engine, Android, CPP, Blueprint, question\
**Created:** [March 23, 2023, 8:31am UTC](https://forums.unrealengine.com/t/iap-query-not-working-v2-android-ue5-1/807149 "2023-03-23T08:31:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-unrealUGSK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alex-unrealUGSK](https://forums.unrealengine.com/u/alex-unrealUGSK)\
**Post date:** [March 23, 2023, 8:31am UTC](https://forums.unrealengine.com/t/iap-query-not-working-v2-android-ue5-1/807149/1 "2023-03-23T08:31:17Z")

</div>

Hi, I struggle to make IAP work on the android platform. To be specific, **purchase is working but the query is not**. I believe all is configured properly because as I said - purchase is working.

I’m utilizing V2 path and this is specified also in the AndroidEngine.ini

```auto
[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=true
bUseStoreV2=True

```

Making query however, leads to this log messages

```auto
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - GetUniqueNetIdFromCachedControllerId
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Invalid UniqueNetId
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Failed to even submit

```

As for the BP part, I’m using this method.  
 ![Screenshot 2023-03-23 at 09.26.25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/1/1c1bfa8556aaeefd9d1291f1c9693bd78fc5a0cd.png)

As you can see, I’m passing PlayerController, but the process fails here:

```auto
FUniqueNetIdRepl QueryingPlayer = PlayerController->GetLocalPlayer()->GetUniqueNetIdFromCachedControllerId();

if (QueryingPlayer.IsValid())
{
 
FFrame::KismetExecutionMessage(TEXT("UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Querying Store Interface"), ELogVerbosity::Warning);
bFailedToEvenSubmit = false;
StoreInterface->QueryOffersById(*QueryingPlayer, ProductIdentifiers, FOnQueryOnlineStoreOffersComplete::CreateUObject(this, &UInAppPurchaseQueryCallbackProxy2::OnInAppPurchaseRead));
}
else
{
					FFrame::KismetExecutionMessage(TEXT("UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Invalid UniqueNetId"), ELogVerbosity::Warning);
}
				}

```

meaning `QueryingPlayer.IsValid()` is false. I checked for the `GetLocalPlayer()` too but it is valid. **Any ideas why this can be?**

_Fun fact - query and purchase works with the same code without problems on iOS_

I will appreciate any ideas, what else to try, or feedback you struggle/or it works for you.

---

<div class="post-metadata">

**Author:** ![gf11speed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gf11speed](https://forums.unrealengine.com/u/gf11speed)\
**Post date:** [October 29, 2023, 8:52pm UTC](https://forums.unrealengine.com/t/iap-query-not-working-v2-android-ue5-1/807149/2 "2023-10-29T20:52:41Z")

</div>

Hi, did you find a solution to this?

I’m seeing the same issue with UE 5.3.1, except it’s happening on iOS. The **IsValid()** call is returning false when attempting an In-App Purchase.

---

<div class="post-metadata">

**Author:** ![paramecij](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@paramecij](https://forums.unrealengine.com/u/paramecij)\
**Post date:** [November 28, 2023, 8:58pm UTC](https://forums.unrealengine.com/t/iap-query-not-working-v2-android-ue5-1/807149/3 "2023-11-28T20:58:09Z")

</div>

> [@alex-unrealUGSK](#):
>
> `Invalid UniqueNetId`

Same here, we are getting ‘Invalid UniqueNetId’ when trying to read or make IAP on IOS.
