Skip to main content
Question

Unity Purchase Problem

  • March 17, 2025
  • 1 reply
  • 32 views

Forum|alt.badge.img
public void InitializeRevenueCat(){    _purchases = GetComponentInChildren<Purchases>();    _userService = ServiceLocator.Instance.GetService<UserService>();        _analyticService = ServiceLocator.Instance.GetService<AnalyticService>();    var builder = Purchases.PurchasesConfiguration.Builder.Init("goog_YguHktEysEcVmKHkVbWMeVQyhjB");    var purchasesConfiguration =        builder            .SetUserDefaultsSuiteName(_userService.CurrentUser.Username)            .SetAppUserId(_userService.CurrentUser.Id)            .SetPurchasesAreCompletedBy(Purchases.PurchasesAreCompletedBy.MyApp,                Purchases.StoreKitVersion.Default)            .Build();    _purchases.SetLogLevel(Purchases.LogLevel.Verbose);    _purchases.Configure(purchasesConfiguration);        Debug.LogWarning("Initialized Revenue Cat Purchases");}  
public void BuyProductWithId(string productId,  Action<bool> onComplete = null){    _purchases.PurchaseProduct(productId, (_, info, cancelled, error) =>    {        if (cancelled)        {            onComplete?.Invoke(false);        }        else if (error != null && !string.IsNullOrEmpty(error.Message))        {            onComplete?.Invoke(false);        }        }  I added the products to the Products section in the RevenueCat dashboard. I am initializing them this way and want to make purchases using the product ID, but I am getting a "Couldn't find product" error. What could be the reason for this? By the way, I haven't created any offers because my game doesn't have an offer or subscription system—only consumable and non-consumable products.
This post has been closed for comments

1 reply

jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • March 19, 2025

Hi ​@ömer-faruk-pehlivan-982e48 - can you confirm that you’re testing this on a physical device (not a simulator) and have followed the Sandbox testing guides (Apple, Google)? Also, can you go through this guide to ensure your store configuration is correct for all relevant platforms?