Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
53e264a
Add RevenueCatUI package
facumenzella Sep 10, 2025
f9683a5
revert code
facumenzella Sep 10, 2025
0a407d2
Add minimum
facumenzella Sep 10, 2025
151ef83
Moved files to RevenueCat/Android
facumenzella Sep 15, 2025
45ad7d0
Moved files from Runtime to Scripts
facumenzella Sep 15, 2025
c4ac9de
Use SimpleJSON
facumenzella Sep 15, 2025
e20e4ce
delete extra .meta
facumenzella Sep 15, 2025
cdd8ea2
Updated bool IsSupported(); doc
facumenzella Sep 15, 2025
be566dd
Added pure code options, removed GameObjecft
facumenzella Sep 15, 2025
c550a2e
Split callback
facumenzella Sep 15, 2025
d1d075e
added debug logs
facumenzella Sep 15, 2025
1a0e59c
Remove StubPaywallPresenter.cs
facumenzella Sep 15, 2025
8b7784b
Delete RevenueCatUICallbackHandler.cs
facumenzella Sep 15, 2025
69096d4
Add missing pieces
facumenzella Sep 15, 2025
c191052
Merge branch 'main' into feat/add-revenuecatui
facumenzella Sep 15, 2025
1ee5dcc
ready
facumenzella Sep 15, 2025
2cbfef6
remove reference to ui package
facumenzella Sep 15, 2025
160ed40
rename to com.revenuecat.unity.ui
facumenzella Sep 16, 2025
e03df34
Merge branch 'main' into feat/add-revenuecatui
facumenzella Sep 16, 2025
c3bd377
Update Subtester/Assets/Scenes/Main.unity
facumenzella Sep 17, 2025
0ad7ba1
Remove extra Stub.meta
facumenzella Sep 17, 2025
a8591ee
Remove README
facumenzella Sep 17, 2025
ffca566
Rename .asmdef files
facumenzella Sep 17, 2025
5417e16
Remove customer center code
facumenzella Sep 17, 2025
9ec1edf
Merge branch 'feat/add-revenuecatui' of github.com:RevenueCat/purchas…
facumenzella Sep 17, 2025
6a43d86
remove _isSupportedCache
facumenzella Sep 17, 2025
0a829d0
Update Subtester/Packages/manifest.json
facumenzella Sep 17, 2025
18b9ba1
renamed editor asmdef and deleted extra files
facumenzella Sep 17, 2025
21ac4df
Merge branch 'feat/add-revenuecatui' of github.com:RevenueCat/purchas…
facumenzella Sep 17, 2025
17aed4a
revert Subtester
facumenzella Sep 17, 2025
d3cca45
Update Subtester/Assets/Plugins/Android/mainTemplate.gradle
facumenzella Sep 17, 2025
f51be9e
Update Subtester/ProjectSettings/AndroidResolverDependencies.xml
facumenzella Sep 17, 2025
1e1ee01
Make properties internal
facumenzella Sep 17, 2025
0143afe
Merge branch 'feat/add-revenuecatui' of github.com:RevenueCat/purchas…
facumenzella Sep 17, 2025
2693a44
minimal paywalls presentation
vegaro Aug 28, 2025
97dec08
clean up
vegaro Sep 17, 2025
980a0e5
Merge branch 'main' into paywalls-android-poc
vegaro Sep 17, 2025
b9bb1e0
clean up
vegaro Sep 17, 2025
b048332
clean up
vegaro Sep 22, 2025
cfbc8d9
move into androidlib
vegaro Sep 22, 2025
1c4c865
add local dependency
vegaro Sep 22, 2025
f072bde
updated mainTemplate.gradle
vegaro Sep 22, 2025
2457709
update PurchasesListener
vegaro Sep 22, 2025
44bc909
gitignore
vegaro Sep 22, 2025
eb27acf
add log to AndroidPaywallPresenter
vegaro Sep 22, 2025
5da75f8
add displayCloseButton
vegaro Sep 22, 2025
56258da
fix compilation of Subtester when exporting package
vegaro Sep 22, 2025
be4ef13
use componentActivity
vegaro Sep 22, 2025
649cff4
presentPaywallIfNeeded
vegaro Sep 22, 2025
e55f375
add close button to log
vegaro Sep 22, 2025
26961f3
add PresentPaywallIfNeeded to PurchasesListener
vegaro Sep 22, 2025
07afd3d
update AndroidResolverDependencies
vegaro Sep 22, 2025
dde2af5
implements PaywallResultHandler
vegaro Sep 26, 2025
96d73f6
rename to PaywallTrampolineActivity and made transparent
vegaro Sep 26, 2025
cf1a839
remove unneeded comment
vegaro Sep 26, 2025
09651b4
TODOs on logs
vegaro Sep 26, 2025
8065057
remove UnityBridge
vegaro Sep 26, 2025
82643ac
Paywalls iOS (#675)
facumenzella Sep 26, 2025
36133cc
Add UI static approach
facumenzella Sep 26, 2025
02dae19
rename namespace
facumenzella Sep 26, 2025
f2ce43a
Merge branch 'main' into feat/revui-mono-nonmono
facumenzella Oct 3, 2025
79a708f
Remove gameobjedct
facumenzella Oct 3, 2025
92d1631
revert RevenueCatUIDependencies.xml
facumenzella Oct 3, 2025
22640ce
delete RevenueCatUI/Tests.meta
facumenzella Oct 3, 2025
c953a71
delete RevenueCatUI/Tests/UITests.cs.meta
facumenzella Oct 3, 2025
b5334a5
delete RevenueCatUI/Tests/revenuecat.purchases-unity-ui.Tests.asmdef.…
facumenzella Oct 3, 2025
23b6ea6
delte tests
facumenzella Oct 3, 2025
692be3b
use new API
facumenzella Oct 3, 2025
2fe6caa
last refactor
facumenzella Oct 3, 2025
9d07906
add async
facumenzella Oct 3, 2025
d733dda
rename final names ultimate
facumenzella Oct 3, 2025
8e08756
nits
facumenzella Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions RevenueCatUI/Scripts/IPaywallPresenter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Threading.Tasks;

namespace RevenueCat.UI
namespace RevenueCatUI.Internal
{
/// <summary>
/// Internal interface for presenting paywalls.
Expand All @@ -13,15 +13,15 @@ internal interface IPaywallPresenter
/// </summary>
/// <param name="options">Paywall presentation options</param>
/// <returns>Result of the paywall presentation</returns>
Task<PaywallResult> PresentPaywallAsync(PaywallOptions options);
Task<RevenueCatUI.PaywallResult> PresentPaywallAsync(RevenueCatUI.PaywallOptions options);

/// <summary>
/// Presents a paywall only if the user does not have the specified entitlement.
/// </summary>
/// <param name="requiredEntitlementIdentifier">Required entitlement identifier</param>
/// <param name="options">Paywall presentation options</param>
/// <returns>Result of the paywall presentation</returns>
Task<PaywallResult> PresentPaywallIfNeededAsync(string requiredEntitlementIdentifier, PaywallOptions options);
Task<RevenueCatUI.PaywallResult> PresentPaywallIfNeededAsync(string requiredEntitlementIdentifier, RevenueCatUI.PaywallOptions options);

/// <summary>
/// Whether paywall presentation is supported on this platform.
Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/Scripts/PaywallOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace RevenueCat.UI
namespace RevenueCatUI
{
/// <summary>
/// Options for configuring paywall presentation.
Expand Down
10 changes: 5 additions & 5 deletions RevenueCatUI/Scripts/PaywallPresenter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using UnityEngine;

namespace RevenueCat.UI
namespace RevenueCatUI.Internal
{
/// <summary>
/// Platform-agnostic factory for paywall presenters.
Expand Down Expand Up @@ -43,16 +43,16 @@ private static IPaywallPresenter CreatePlatformPresenter()
/// </summary>
internal class UnsupportedPaywallPresenter : IPaywallPresenter
{
public Task<PaywallResult> PresentPaywallAsync(PaywallOptions options)
public Task<RevenueCatUI.PaywallResult> PresentPaywallAsync(RevenueCatUI.PaywallOptions options)
{
Debug.LogWarning("[RevenueCatUI] Paywall presentation is not supported on this platform.");
return Task.FromResult(PaywallResult.Error);
return Task.FromResult(RevenueCatUI.PaywallResult.Error);
}

public Task<PaywallResult> PresentPaywallIfNeededAsync(string requiredEntitlementIdentifier, PaywallOptions options)
public Task<RevenueCatUI.PaywallResult> PresentPaywallIfNeededAsync(string requiredEntitlementIdentifier, RevenueCatUI.PaywallOptions options)
{
Debug.LogWarning("[RevenueCatUI] Paywall presentation is not supported on this platform.");
return Task.FromResult(PaywallResult.Error);
return Task.FromResult(RevenueCatUI.PaywallResult.Error);
}

public bool IsSupported()
Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/Scripts/PaywallResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace RevenueCat.UI
namespace RevenueCatUI
{
/// <summary>
/// Represents the result of a paywall presentation.
Expand Down
42 changes: 42 additions & 0 deletions RevenueCatUI/Scripts/PaywallsBehaviour.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.Threading.Tasks;
using UnityEngine;

namespace RevenueCatUI
{
/// <summary>
/// MonoBehaviour helper that forwards to the static PaywallsPresenter API so paywalls can be driven from scenes.
/// </summary>
public class PaywallsBehaviour : MonoBehaviour
{
/// <summary>
/// Presents a paywall configured in the RevenueCat dashboard.
/// </summary>
/// <param name="options">Options for presenting the paywall.</param>
/// <returns>A <see cref="PaywallResult"/> describing the outcome.</returns>
public async Task<PaywallResult> PresentPaywall(PaywallOptions options = null)
{
return await PaywallsPresenter.Present(options);
}

/// <summary>
/// Presents a paywall only if the user does not have the specified entitlement.
/// </summary>
/// <param name="requiredEntitlementIdentifier">Entitlement identifier to check before presenting.</param>
/// <param name="options">Options for presenting the paywall.</param>
/// <returns>A <see cref="PaywallResult"/> describing the outcome.</returns>
public async Task<PaywallResult> PresentPaywallIfNeeded(string requiredEntitlementIdentifier, PaywallOptions options = null)
{
return await PaywallsPresenter.PresentIfNeeded(requiredEntitlementIdentifier, options);
}

/// <summary>
/// Checks if the Paywall UI is available on the current platform.
/// Returns true on iOS/Android device builds when paywall is supported; otherwise false.
/// </summary>
/// <returns>True if UI is supported on this platform, otherwise false.</returns>
public bool IsSupported()
{
return PaywallsPresenter.IsSupported();
}
}
}
2 changes: 2 additions & 0 deletions RevenueCatUI/Scripts/PaywallsBehaviour.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Android;
using RevenueCatUI.Internal;

namespace RevenueCat.UI.Platforms
namespace RevenueCatUI.Platforms
{
internal class AndroidPaywallPresenter : IPaywallPresenter
{
Expand Down
3 changes: 2 additions & 1 deletion RevenueCatUI/Scripts/Platforms/iOS/IOSPaywallPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using RevenueCatUI.Internal;

namespace RevenueCat.UI.Platforms
namespace RevenueCatUI.Platforms
{
internal class IOSPaywallPresenter : IPaywallPresenter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
using System;
using System.Threading.Tasks;
using UnityEngine;
using RevenueCatUI.Internal;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes for PaywallsPresenter


namespace RevenueCat.UI
namespace RevenueCatUI
{
/// <summary>
/// Main interface for RevenueCat UI components.
/// Main interface for RevenueCatUI paywall presentation.
/// Provides static methods to present paywalls.
/// </summary>
public static class RevenueCatUI
public static class PaywallsPresenter
{

/// <summary>
/// Presents a paywall configured in the RevenueCat dashboard.
/// </summary>
/// <param name="options">Options for presenting the paywall</param>
/// <returns>A PaywallResult indicating what happened during the paywall presentation</returns>
public static async Task<PaywallResult> PresentPaywall(PaywallOptions options = null)
public static async Task<PaywallResult> Present(PaywallOptions options = null)
{
try
{
Expand All @@ -38,7 +39,7 @@ public static async Task<PaywallResult> PresentPaywall(PaywallOptions options =
/// <param name="requiredEntitlementIdentifier">Entitlement identifier to check before presenting</param>
/// <param name="options">Options for presenting the paywall</param>
/// <returns>A PaywallResult indicating what happened during the paywall presentation</returns>
public static async Task<PaywallResult> PresentPaywallIfNeeded(
public static async Task<PaywallResult> PresentIfNeeded(
string requiredEntitlementIdentifier,
PaywallOptions options = null)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "revenuecat.purchases-unity-ui",
"rootNamespace": "RevenueCat.UI",
"rootNamespace": "RevenueCatUI",
"references": [
"revenuecat.purchases-unity"
],
Expand Down
33 changes: 16 additions & 17 deletions Subtester/Assets/Scripts/PurchasesListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using RevenueCat.UI;

public class PurchasesListener : Purchases.UpdatedCustomerInfoListener
{
Expand Down Expand Up @@ -231,7 +230,7 @@ void PresentPaywallIfNeeded()

private System.Collections.IEnumerator PresentPaywallCoroutine()
{
var task = RevenueCat.UI.RevenueCatUI.PresentPaywall();
var task = RevenueCatUI.PaywallsPresenter.Present();
while (!task.IsCompleted) { yield return null; }

var result = task.Result;
Expand All @@ -241,8 +240,8 @@ private System.Collections.IEnumerator PresentPaywallCoroutine()
{
string status = GetPaywallResultStatus(result);

if (result.Result == RevenueCat.UI.PaywallResultType.Purchased ||
result.Result == RevenueCat.UI.PaywallResultType.Restored)
if (result.Result == RevenueCatUI.PaywallResultType.Purchased ||
result.Result == RevenueCatUI.PaywallResultType.Restored)
{
GetComponent<Purchases>().GetCustomerInfo((customerInfo, error) => {
if (error != null)
Expand All @@ -264,12 +263,12 @@ private System.Collections.IEnumerator PresentPaywallCoroutine()

private System.Collections.IEnumerator PresentPaywallWithOptionsCoroutine()
{
var options = new RevenueCat.UI.PaywallOptions
var options = new RevenueCatUI.PaywallOptions
{
DisplayCloseButton = false
};

var task = RevenueCat.UI.RevenueCatUI.PresentPaywall(options);
var task = RevenueCatUI.PaywallsPresenter.Present(options);
while (!task.IsCompleted) { yield return null; }

var result = task.Result;
Expand Down Expand Up @@ -327,15 +326,15 @@ private System.Collections.IEnumerator PresentPaywallForOfferingCoroutine()
}

// Create options with specific offering
var options = new RevenueCat.UI.PaywallOptions
var options = new RevenueCatUI.PaywallOptions
{
OfferingIdentifier = offeringId,
DisplayCloseButton = true
};

Debug.Log($"Subtester: Presenting paywall for offering: {options.OfferingIdentifier}");

var task = RevenueCat.UI.RevenueCatUI.PresentPaywall(options);
var task = RevenueCatUI.PaywallsPresenter.Present(options);
while (!task.IsCompleted) { yield return null; }

var result = task.Result;
Expand Down Expand Up @@ -393,7 +392,7 @@ private System.Collections.IEnumerator PresentPaywallIfNeededCoroutine()
}

// Create options for the test
var options = new RevenueCat.UI.PaywallOptions
var options = new RevenueCatUI.PaywallOptions
{
OfferingIdentifier = offeringId,
DisplayCloseButton = true // Test with close button enabled
Expand All @@ -404,7 +403,7 @@ private System.Collections.IEnumerator PresentPaywallIfNeededCoroutine()

Debug.Log($"Subtester: Testing presentPaywallIfNeeded for entitlement: {testEntitlement}, offering: {options.OfferingIdentifier}");

var task = RevenueCat.UI.RevenueCatUI.PresentPaywallIfNeeded(testEntitlement, options);
var task = RevenueCatUI.PaywallsPresenter.PresentIfNeeded(testEntitlement, options);
while (!task.IsCompleted) { yield return null; }

var result = task.Result;
Expand All @@ -414,27 +413,27 @@ private System.Collections.IEnumerator PresentPaywallIfNeededCoroutine()
{
var status = GetPaywallResultStatus(result);
var message = $"PaywallIfNeeded for '{testEntitlement}' result: {status}";
if (result.Result == RevenueCat.UI.PaywallResultType.NotPresented)
if (result.Result == RevenueCatUI.PaywallResultType.NotPresented)
{
message += " (User already has entitlement)";
}
infoLabel.text = message;
}
}

private string GetPaywallResultStatus(RevenueCat.UI.PaywallResult result)
private string GetPaywallResultStatus(RevenueCatUI.PaywallResult result)
{
switch (result.Result)
{
case RevenueCat.UI.PaywallResultType.Purchased:
case RevenueCatUI.PaywallResultType.Purchased:
return "PURCHASED - User completed a purchase";
case RevenueCat.UI.PaywallResultType.Restored:
case RevenueCatUI.PaywallResultType.Restored:
return "RESTORED - User restored previous purchases";
case RevenueCat.UI.PaywallResultType.Cancelled:
case RevenueCatUI.PaywallResultType.Cancelled:
return "CANCELLED - User dismissed the paywall";
case RevenueCat.UI.PaywallResultType.Error:
case RevenueCatUI.PaywallResultType.Error:
return "ERROR - An error occurred during paywall";
case RevenueCat.UI.PaywallResultType.NotPresented:
case RevenueCatUI.PaywallResultType.NotPresented:
return "NOT PRESENTED - Paywall was not needed";
default:
return $"UNKNOWN - Received: {result}";
Expand Down