Search Unity

[Closed] In-app purchase how add price to product

Discussion in 'Unity IAP' started by teamfireplay, Jan 9, 2016.

Thread Status:
Not open for further replies.
  1. teamfireplay

    teamfireplay

    Joined:
    Dec 29, 2015
    Posts:
    1
    I have this code from documentation
    How add metadata to product?(Windows universal )
    Code (CSharp):
    1. private IStoreController controller;
    2.     private IExtensionProvider extensions;
    3.     private bool m_PurchaseInProgress;
    4.  
    5.     public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
    6.     {
    7.         this.controller = controller;
    8.         this.extensions = extensions;
    9.     }
    10.     public void OnInitializeFailed(InitializationFailureReason error)
    11.     {
    12.     }
    13.  
    14.     public void OnPurchaseFailed(Product item, PurchaseFailureReason r)
    15.     {
    16.     }
    17.  
    18.     public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
    19.     {
    20.         return PurchaseProcessingResult.Complete;
    21.     }
    22.  
    23.     public void MyIAPManager()
    24.     {
    25.         ProductMetadata tom = new ProductMetadata("12$", "tom", "i love", "dollar", 12);
    26.        
    27.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    28.         builder.AddProduct("Game without ads", ProductType.NonConsumable, new IDs
    29.         {
    30.             {"Game without ads", WinRT.Name},
    31.         });
    32.      
    33.         UnityPurchasing.Initialize(this, builder);
    34.     }
     
  2. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hi @teamfireplay,

    Thank you for bringing this up, this was an oversight on our part in the documentation. As of right now this is not possible, but it could potentially be added to a future release. Other than that I cannot give you any real information about when/if it will be added.

    Would you mind elaborating on your use case? We want to make sure we account for as many use cases as possible when we are developing new features!

    If you are wanting a way to set metadata for a product in just one place and have it pushed out to all of the stores. We agree that this would be very helpful!
     
  3. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Product metadata comes from the store, it is not set by the game developer. The reason ProductMetadata is a public type is for those implementing their own stores.
     
Thread Status:
Not open for further replies.