Android IAP "Query for Owned In-App Products" fails with Invalid player UniqueNetId unless the player is signed into Play Games

Summary

On UE 5.8.4 (launcher, CL 58902052), the Blueprint node “Query for Owned In-App Products” rejects the call before Google Play Billing runs.

UInAppPurchaseReceiptsCallbackProxy::TriggerGetOwnedProducts requires PlayerController->GetLocalPlayer()->GetUniqueNetIdFromCachedControllerId() to be valid.

That value comes from UOnlineEngineInterfaceImpl::GetUniquePlayerIdWrapper and then FOnlineIdentityGooglePlay::GetUniquePlayerId.

For local user 0 that returns LocalPlayerAccount->GetUserId() only when LocalPlayerAccount is set, otherwise FUniqueNetIdGooglePlay::EmptyId().

EmptyId() is an empty string, and FUniqueNetIdString::IsValid() is false for an empty string.

LocalPlayerAccount is set only by FOnlineIdentityGooglePlay::SetIdentityData, which FOnlineAsyncTaskGooglePlayLogin::Finalize calls after a successful Play Games sign-in (GooglePlayGamesWrapper / GamesSignInClient / Player.getPlayerId()).

Play Billing is a separate path: GooglePlayStoreHelper uses BillingClient, and QueryExistingPurchases() takes no player id. On a device with no Play Games sign-in, billing is already connected when the node fails.

What Type of Bug are you experiencing?

Online

Steps to Reproduce

  1. Create a project in Unreal Engine 5.8.4 from the launcher and set the default platform to Android.
  2. Enable the Online Subsystem Google Play plugin. In Config/DefaultEngine.ini:
[OnlineSubsystem]
DefaultPlatformService=GooglePlay

[OnlineSubsystemGooglePlay.Store]
bEnableGooglePlaySupport=True
bSupportsInAppPurchasing=True
  1. Do not create a Play Games Services project, and do not call a Play Games login.
  2. Package or Quick Launch to an Android device.
  3. After the log shows in-app billing is supported, call the Blueprint node “Query for Owned In-App Products”

Expected Result

The node calls IOnlinePurchase::QueryReceipts, which reaches GooglePlayStoreHelper.QueryExistingPurchases(), and returns the owned products or an empty list. Play Billing does not require a Play Games player id.

Observed Result

The node fires its failure pin immediately. adb logcat shows billing already up, then the local reject:

[GooglePlayStoreHelper] - In-app billing supported
[GooglePlayStoreHelper] - Billing Config is now valid
LogBlueprintUserMessages: Fetching purchase info
LogScript: Warning: Script Msg: UInAppPurchaseCallbackProxy::Trigger - Invalid player UniqueNetId
LogBlueprintUserMessages: Failed

QueryReceipts is never called. The same GetUniqueNetIdFromCachedControllerId() check is in TriggerGetKnownReceipts. Play In Editor on Windows does not show this warning, because the editor cannot load the Google Play subsystem and falls back to the NULL online subsystem, which has a valid local id.

Affects Versions

5.8

Platform(s)

Android