Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Solved] Unity IAP on Windows Store

Discussion in 'Unity IAP' started by milox777, Nov 29, 2015.

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

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    119
    I cannot get Unity IAP to work to be able to test it on Windows Store app:
    Here's the error I'm getting:

    Code (CSharp):
    1.  info:LoadListingInformationAsync() invoked.    (Windows::ApplicationModel::Store::CurrentAppFactory::LoadListingInformationAsync)
    2. ERROR:ChkHr(spStoreCommerce->Initialize(HStringReference(wszCV).Get()))    (0x803f6107)    (Windows::ApplicationModel::Store::CurrentAppFactory::GetStoreCommerce)
    3. ERROR:ChkHr(GetStoreCommerce(&spStoreCommerce))    (0x803f6107)    (Windows::ApplicationModel::Store::CurrentAppFactory::LoadListingInformationAsync)
    4.  
    5.  
    6. UnibillWin8:Exception loading listing information:Exception from HRESULT: 0x805A0194
    7.  
    8.  

    I did everything as shown in the tutorial and documentation, I've enabled mockIAP function, here's my init code:

    Code (CSharp):
    1.  var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    2.         builder.Configure<IMicrosoftConfiguration>().useMockBillingSystem = true;
    3.         foreach (IAPItem ia in IAPManager.GoldItems)
    4.         {
    5.             builder.AddProduct(ia.ID, ProductType.Consumable, new IDs() { { ia.ID, AppleAppStore.Name },
    6.             { ia.ID, WinRT.Name }, { ia.ID, WindowsPhone8.Name }, { ia.ID, GooglePlay.Name }  });
    7.         }
    8.         foreach (IAPItem ia in IAPManager.CashItems)
    9.         {
    10.             Debug.Log("IAP init id" + ia.ID);
    11.             builder.AddProduct(ia.ID, ProductType.Consumable, new IDs() { { ia.ID, AppleAppStore.Name },
    12.             { ia.ID, WinRT.Name }, { ia.ID, WindowsPhone8.Name }, { ia.ID, GooglePlay.Name }  });
    13.         }
    14.      
    15.         UnityPurchasing.Initialize(this, builder);
    Any help?
     
    Last edited: Nov 29, 2015
  2. mpinol

    mpinol

    Unity Technologies

    Joined:
    Jul 29, 2015
    Posts:
    319
  3. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    119
    @mpinol Nevermind, I've found the solution, documentation was wrong, you have to set useMockBillingSystem on the purchasing module instance:
    Code (CSharp):
    1.    var module = StandardPurchasingModule.Instance();
    2.         module.useMockBillingSystem = true; // Microsoft
    3.         var builder = ConfigurationBuilder.Instance(module);
     
    Last edited: Dec 1, 2015
  4. codeDoc

    codeDoc

    Joined:
    Feb 12, 2014
    Posts:
    6
    I Cannot build IAP on Il2cpp, Is IAP not supported yet on IL2CPP?

    Code (CSharp):
    1. Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'
    2.    at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
    3.    at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
    4.    at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
    5.    at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences(AssemblyDefinition assembly)
    6.    at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
    7.    at Mono.Linker.Pipeline.Process(LinkContext context)
    8.    at Mono.Linker.Driver.RunDriver(Driver driver)
    Full log here
    http://pastebin.com/SuX6q3zq
     
  5. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @codeDoc what makes you think that error is related to IAP?
     
  6. codeDoc

    codeDoc

    Joined:
    Feb 12, 2014
    Posts:
    6
    Well, It built successfully before I added IAP , and After I added IAP I got that error. Again tried on the empty project with default IAP Demo scene and still same error. I have no other plugins yet except DOTween and DOTween Builds successfully. I searched for documentation that says Il2cpp wont work with managed plugin with .net 4.5

    https://docs.unity3d.com/Manual/windowsstore-plugins-il2cpp.html

    I might be wrong please can you confirm that
     
  7. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    You are correct, on Windows Store we don't currently support the IL2CPP scripting backend. It will require us to rewrite the managed IAP DLL. For now you'll need to use the .NET scripting backend to use Unity IAP. Thanks for raising this.
     
  8. codeDoc

    codeDoc

    Joined:
    Feb 12, 2014
    Posts:
    6
    I just want to know will it be releasing anytime soon, because .Net is too slow and we are getting different issues we don't want to deal since IL2CPP is working for all other .if it takes time then we might need to create workaround plugin ourself, none of the plugin in assetstore seems to work in IL2CPP yet. We are hoping to submit game for windows competition. Everything except IAP is working and in good shape in IL2CPP.
     
    Last edited: Dec 31, 2015
  9. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Windows IL2CPP support for managed plugins is being worked on but is unlikely to arrive before 3-5 months time; for now IL2CPP remains experimental on Windows phone/store. You'd need to look at alternatives before then.
     
  10. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    421
    if you did would you sell it on the asset store?
     
  11. Nitin_CMLABS

    Nitin_CMLABS

    Joined:
    Jul 10, 2015
    Posts:
    15
    I am getting issue in Initializing the Product id in window's store

    Code for Initializing is:


    public void InitializePurchasing()
    {
    if (IsInitialized())
    {
    return;
    }

    var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());

    // Add a product to sell / restore by way of its identifier, associating the general identifier with its store-specific identifiers.
    builder.AddProduct(kProductIDConsumableGrassStack500, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack500, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack1500, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack1500, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack3000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack3000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack5000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack5000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack10000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack10000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStackRemoveAd, ProductType.NonConsumable, new IDs(){{ kProductIDConsumableGrassStackRemoveAd, WindowsStore.Name }});
    UnityPurchasing.Initialize(this, builder);
    }

    Please review the code and let me know if something is wrong in this.

    It's working fine in Unity_Editor but getting issue in Window's 10
     
  12. Nitin_CMLABS

    Nitin_CMLABS

    Joined:
    Jul 10, 2015
    Posts:
    15
    Hello, I am getting issue in Initializing the product id at Unity Window's IAP store while it's working fine in Unity_Editor but getting issue when i export it for Window 10 and run from visual studio 2015.

    Code for Initializing is :


    public void InitializePurchasing()
    {
    // If we have already connected to Purchasing ...
    if (IsInitialized())
    {
    // ... we are done here.
    return;
    }

    var module = StandardPurchasingModule.Instance();

    // Create a builder, first passing in a suite of Unity provided stores.
    var builder = ConfigurationBuilder.Instance(module);

    // Add a product to sell / restore by way of its identifier, associating the general identifier with its store-specific identifiers.
    builder.AddProduct(kProductIDConsumableGrassStack500, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack500, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack1500, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack1500, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack3000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack3000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack5000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack5000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDConsumableGrassStack10000, ProductType.Consumable, new IDs(){{ kProductIDConsumableGrassStack10000, WindowsStore.Name }});// Continue adding the non-consumable product.
    builder.AddProduct(kProductIDNonConsumableRemoveAd, ProductType.NonConsumable, new IDs(){{ kProductIDNonConsumableRemoveAd, WindowsStore.Name }});// And finish adding the subscription product.
    UnityPurchasing.Initialize(this, builder);
    }


    Do i need to setup some setting in Unity or need to edit the code?
     
  13. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    What problem are you having on windows 10?

    Also, you don't need to add store specific product IDs - if your product is defined as kProductIDConsumableGrassStack500 then just define it that way:

    builder.AddProduct(kProductIDConsumableGrassStack500, ProductType.Consumable);

    Unity IAP assumes it has this ID on all platforms unless you tell it otherwise.
     
Thread Status:
Not open for further replies.
unityunity