Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Changing IAP prices after publishing

Discussion in 'Unity IAP' started by Job_MTalha, Apr 20, 2021.

  1. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Can we Change the Unity IAP prices at runtime? What I have in mind is to fetch the prices from the server and use those prices after the game is published. I want to tweak those prices according to seasons without having to update the app.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    No, never change the prices once you publish. You set the prices on your Google and Apple dashboards. If I were a user and purchased at price A then it was changed to a lower price B later, I might be concerned. You need separate products to support separate prices.
     
  3. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Hi,
    I have several items in a bundle. Lets say Bundle X contains ( item A B and C) at 2.99$ and after a while through analysis I realise that players are more keen on Items J K and L. I want to make a bundle out of those items i.e Bundle Y containing (item J, K and L) at 3.99$. That is why.

    but my main question is can we do it? is it possible?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    If the stores allow you to change the prices after publishing, then yes. You would need to change the price on the store dashboard, then reflect the same prices in your app. You could use Unity Remote Config for that https://docs.unity3d.com/Packages/com.unity.remote-config@2.0/manual/index.html
     
  5. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    There's no other way? I dont want to use remote config right now. Maybe I can Make different IAP buttons of different prices and Activate Deactivate according to my needs. What I mean is that

    I have lets say 10 different IAP buttons each with Different prices. Once I get my Updated catalogue (with bundles updated prices) and then activate and deactivate the relevant buttons?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Well of course, but you're not changing prices at that point, you already have them set up. You still need to change the prices on the Dashboard, or just have different products, similar but with a different price
     
    Job_MTalha likes this.
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    How do you plan to activate/deactivate buttons "according to your needs"? You mentioned that you don't want to do it remotely, so that implies a new release each time.
     
  8. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    I am using playfab as a backend service. So calling a cloudscript function to grab the values. And Putting checks inside app.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Nice! Similar to my mention of Remote Config, that works too.
     
    Job_MTalha likes this.
  10. Job_MTalha

    Job_MTalha

    Joined:
    Jan 14, 2021
    Posts:
    61
    Yes Thanks alot for that tip, I dint know about Remote config. Its a bit of work, I am trying to keep eveything as simple as i possible right now.
     
  11. alikun

    alikun

    Joined:
    Oct 17, 2018
    Posts:
    16
    This is exactly what I was looking for. Thanks to you both.
    What I am stuck on is how can I create products in IAP Catalog after I retrieve the prices/products remotely?
    What should I use in the code for that?
     
  12. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    151
  13. alikun

    alikun

    Joined:
    Oct 17, 2018
    Posts:
    16
    @John_Corbett Yeah, did it already and works like a charm
    Thanks :)
     
  14. abdullahsofttik23

    abdullahsofttik23

    Joined:
    Jan 9, 2023
    Posts:
    2
    @alikun Hi can you please share some examples of how you changed the price at runtime I'm building the shopping system in Unity obviously I can't set a fixed price in the IAP Catalog price will change when more and more products will add to the chart Thanks
     
  15. alikun

    alikun

    Joined:
    Oct 17, 2018
    Posts:
    16
    Here, I have a list of IAP scriptable objects with Id and Type fields and add them to builder instance. Later, I initialise the builder instance. This all happens in a class derived from IStoreListener. But you still need to add an tap item in the Unity project when you add it in App Store Connect or Play Console.

    Code (CSharp):
    1.                 var productScriptables = iapItems.OrderBy(o => o.Price).ToList();
    2.  
    3.                 var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    4.  
    5.                 foreach (var productScriptable in productScriptables)
    6.                 {
    7.                     builder.AddProduct(productScriptable.Id,productScriptable.Type);
    8.                 }
    9.  
    10.                 UnityPurchasing.Initialize(this, builder);