Repository navigation
Show Android paywalls in-window so C# purchase controllers work - #15
Merged
Merged
Conversation
…ests - Native: if a purchase/restore request can't be sent to Unity, fail it immediately instead of awaiting a reply that can never come. - Native: when the awaiting coroutine is cancelled, record the callbackId (bounded) and send purchaseCancelled/restoreCancelled to C#. Late replies for abandoned or unknown ids are logged instead of silently dropped. - Native: expose isPurchaseControllerRequestPending so C# can skip a request that sat in Unity's message queue after native gave up on it, rather than starting a real store transaction with no paywall on screen. - C#: reply Failed when the purchase controller throws, reply at most once, and don't report results for cancelled requests. No purchase timeout is added: store transactions can legitimately take minutes (pending payments, SCA).
Adds SuperwallOptions.Paywalls.AndroidPresentation (InWindow by default, or Activity) and passes it to superwall-android's presentationHost. Configure without options also uses in-window. Store.CUSTOM maps to "other". Temporarily pins superwall-android 2.8.5-inwindow.4 from mavenLocal (also added to the CI harness) until the in-window host is released.
ianrumac
marked this pull request as ready for review
October 20, 2026 08:17
2.8.7 ships the in-window paywall host, so the mavenLocal() pin and the CI harness repository are no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses superwall-android 2.8.7, which ships the in-window host from superwall/Superwall-Android#481, and Google Play Billing 9.1.0 to match it (up from 2.7.23 / 8.0.0 on
main).Problem
On Android, a Unity game with a C# purchase controller hangs on the purchase spinner.
SuperwallPaywallActivitycoversUnityPlayerActivity/UnityPlayerGameActivity, and Unity pauses its player loop. The native SDK sendspurchaseFromGooglePlaythroughUnitySendMessage, which only runs on Unity's main loop, so C# never receives it. X and back are blocked while the purchase is pending. Every other delegate callback (didPresent,TransactionStart, …) is also held until the paywall closes.Changes
Paywalls in the game's window (default)
SuperwallOptions.Paywalls.AndroidPresentation:InWindow(default) orActivity. The bridge maps it to superwall-android'sPaywallOptions.presentationHost, andConfigurewithout options also uses in-window.Store.CUSTOMis mapped to"other"in the bridge.Bridge hardening (separate commit)
purchaseCancelled/restoreCancelled.isPurchaseControllerRequestPendinglets C# skip a request that sat in Unity's queue after native abandoned it, rather than starting a store transaction with no paywall on screen.Failed, and each request is answered at most once. Late replies for unknown ids are logged instead of silently dropped.Testing
Unity 6000.4, Android emulator API 30, Play test account. Report with screenshots and event timings.
Activitymode:transaction_start, then nothing.TransactionStart, Unity IAP confirms the order, and the paywall closes with the game running. Verified onUnityPlayerGameActivityandUnityPlayerActivity.Activitymode C# gets them all on one frame after close (36 s late in one run); in-window, within a frame.BridgeContractTestscover the hardening paths.