Merged
Conversation
vegaro
commented
Aug 28, 2025
tonidero
reviewed
Aug 29, 2025
Contributor
tonidero
left a comment
There was a problem hiding this comment.
I think the approach makes sense... I just have that question about how the presentPaywallIfNeeded method would look like and whether that could cause any UI glitches by presenting the proxy activity without need though.
Co-authored-by: Cesar de la Vega <[email protected]>
…es-unity into feat/add-revenuecatui
Member
Author
|
This PR requires RevenueCat/purchases-android#2695 |
tonidero
reviewed
Sep 30, 2025
Contributor
tonidero
left a comment
There was a problem hiding this comment.
Looking pretty good! Just some minor questions and comments
...enueCatUI.androidlib/src/main/java/com/revenuecat/purchasesunity/ui/PaywallUnityOptions.java
Show resolved
Hide resolved
...tUI.androidlib/src/main/java/com/revenuecat/purchasesunity/ui/PaywallTrampolineActivity.java
Show resolved
Hide resolved
...tUI.androidlib/src/main/java/com/revenuecat/purchasesunity/ui/PaywallTrampolineActivity.java
Outdated
Show resolved
Hide resolved
RevenueCatUI/Scripts/Platforms/Android/AndroidPaywallPresenter.cs
Outdated
Show resolved
Hide resolved
RevenueCatUI/Scripts/Platforms/Android/AndroidPaywallPresenter.cs
Outdated
Show resolved
Hide resolved
RevenueCatUI/Scripts/Platforms/Android/AndroidPaywallPresenter.cs
Outdated
Show resolved
Hide resolved
github-merge-queue bot
pushed a commit
to RevenueCat/purchases-android
that referenced
this pull request
Sep 30, 2025
…ity and correct usage of launch
# Conflicts: # Subtester/Assets/Plugins/Android/mainTemplate.gradle # Subtester/ProjectSettings/AndroidResolverDependencies.xml
vegaro
added a commit
that referenced
this pull request
Oct 3, 2025
This wasn't intended to be merged with #649
vegaro
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Oct 15, 2025
Required for RevenueCat/purchases-unity#649 (cherry picked from commit 656542a)
vegaro
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Oct 15, 2025
vegaro
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Oct 15, 2025
vegaro
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Oct 15, 2025
vegaro
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Oct 15, 2025
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.
We created a
PaywallProxyActivity, instead of using the regular fragment we normally use for presenting paywalls in the hybrids. The reason is that we can't use Unity apps use UnityPlayerActivity as the main activity, which is not FragmentActivity. In Flutter we ask devs to implement FragmentActivity in their Activity, but it's not easy to do that in Unity.For callbacks we use UnitySendMessage, since that's the simplest way without having to rewrite the way we present paywalls to be able to communicate paywall results. It Unity's built-in GameObject messaging system, which I tested and acts as a queue, which is nice since it means the message will come back as soon as
PaywallProxyActivityis closed, behaving very similar toonActivityResult. This avoids rewriting existing paywall presentation architecture, which was in progress and we can still do if we want to support real-time paywall notifications.To hold the Java code, I created a
androidlibfolder, following the docs https://docs.unity3d.com/Manual/android-library-plugin-create.html. The reason is that it's the only way to include an AndroidManifest.xml, the alternative is building an aar, which wuld require external build process and complicate development workflow.EDIT: The circular dependency issue is not an issue anymore and has been solved with #649 (comment), but keeping it here for reference
Circular dependency issue
This is how the Gradle dependencies look like:
We need to call Unity functions (see
UnityBridge) using reflection. The androidlib is converted into a module, and theunityLibrarymodule depends on it (implementation project(':RevenueCatUI.androidlib'). That means adding a dependency onunityLibraryinRevenueCatUI.androidlibwould create a circular dependency. That's why I build theUnityBridge.Usage
Followups