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
[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=true
bUseStoreV2=True
Making query however, leads to this log messages
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - GetUniqueNetIdFromCachedControllerId
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Invalid UniqueNetId
UInAppPurchaseQueryCallbackProxy2::TriggerQuery - Failed to even submit
As for the BP part, I’m using this method.
As you can see, I’m passing PlayerController, but the process fails here:
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.