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

Resolved "IAPButton deprecated, use CodelessIAPButton" but CodelessIAPButton doesn't exist?

Discussion in 'Unity IAP' started by DaveKap, Aug 19, 2023.

  1. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    I'm patching my game and noticed that my IAP Button is now considered legacy and deprecated (despite still working just fine) with the message "IAPButton is deprecated, please use CodelessIAPButton instead." However, even with the In App Purchasing package updated to 4.9.4, I do not see any "CodelessIAPButton" component available for use. Is this some kind of misnomer or am I missing something here? If my IAP Button is legacy and deprecated, when will it stop working?

    I'm using Unity 2021.3.29f1
     
    Last edited: Aug 19, 2023
  2. hibbygames

    hibbygames

    Joined:
    Mar 19, 2015
    Posts:
    43
    I ran into the same thing. I think it's this, the one that doesn't say legacy. One thing that sucks, it doesn't have a place to link text and show the price anymore Screenshot 2023-09-02 211945.png
     
  3. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    Yeah I was wondering why it doesn't show pricing anymore. That's really awful!
     
  4. hibbygames

    hibbygames

    Joined:
    Mar 19, 2015
    Posts:
    43
    I was able to get it to show the price by using the "On Product Fetched" event that's on the button inspector to get info that includes the price.
    Screenshot 2023-09-24 114843.png
    And then inside my linked script I had this to display the price on my text:

    Code (CSharp):
    1. public void IAPlisteneerFetch(Product _product)
    2. {
    3.     print("IAP Fetch " + _product.definition.id);
    4.  
    5.     if (_product.definition.id == "com.company.game.iap")
    6.     {
    7.         tmpPriceiap.text = _product.metadata.localizedPriceString;
    8.     }
    9.    
    10. }
     
    DaveKap likes this.
  5. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    Oh nice! I managed to get some code working to have it happen on initialization but this might be a better call. Thanks for the help!

    Edit: I removed an entire IAP management script thanks to your help! This is great. I wish the documentation pointed this out instead of being as severely lacking as it is.
     
    Last edited: Sep 25, 2023
    hibbygames likes this.