Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity IAP package 1.1.0 is now available

Discussion in 'Scripting' started by Banderous, Dec 4, 2015.

  1. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    An updated IAP store package is now available. Existing users can update in the cloud services window, under In-App Purchasing, by pressing the 'import' button again.

    From the changelog (in the root UnityPurchasing folder):

    ## [1.1.0] - 2015-12-4
    ### Fixed
    - Mac App Store - Base64 receipt payload containing newlines.
    - Hiding of internal store implementation classes not necessary for public use.

    ### Added
    - IAppleConfiguration featuring an 'appReceipt' string property for reading the App Receipt from the device, if any;

    Code (CSharp):
    1.  
    2. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    3. // On iOS & Mac App Store, receipt will be a Base64 encoded App Receipt, or null
    4. // if no receipt is present on the device.
    5. // On other platforms, receipt will be a dummy placeholder string.
    6. string receipt = builder.Configure<IAppleConfiguration> ().appReceipt;
     
    myama, nicholasr and johncturiya like this.
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Is the user guide been updated and where is the Amazon support?
     
  3. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    The above documentation will be added to the user guide. There's no fixed date for amazon support at present.
     
    MrEsquire likes this.
  4. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks for the update, I know many people wish for Amazon as something higher in priority.
    Firstly the reason being as the older platforms die out such as BlackBerry and Amazon producing more devices, the stores are installed on these and more people are downloading from Amazon store, also the special deals they do.

    Technically you would not need to be supporting many platforms, iOS/Android/Win and Amazon.
    If the problem is work on your side then really its not some major task, if you look at Prime31 plugins, they been made and only time updated when a bug is found or the major companies announce changes.

    In the end the IAP support is welcome, as really most of us are sick of rip of and poorly coded INAPP plugins :)

    Keep up the good work
     
  5. plailabs-dev

    plailabs-dev

    Joined:
    Dec 10, 2012
    Posts:
    12
    I have a question, will this service (like the crash reporting apis) allow developers to create their own back ends but keep the game implementation? In our case we have our own servers that take care of receipt validation and tracking, which in turn integrate to our publisher's backend promotions server, etc. We currently rely on a third party client api (Prime 31). Can we use the new client APIs but connect to our own servers (not the unity cloud ones).

    Thanks,

    Alejandro.
     
  6. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    As of Unity 5.3 there is no back end for Unity IAP, it is a purely client side transaction API that will give you purchase receipts you can forward to any backend you like.
     
  7. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    @Banderous

    I'm having a problem with Unity IAP plugin on Windows Store app, here's the error I'm getting, I sideloaded the debug build on a local machine and launched debugging via Visual Studio:

    Code (CSharp):
    1.  
    2. info:get_LicenseInformation() invoked.    (Windows::ApplicationModel::Store::CurrentAppFactory::get_LicenseInformation)
    3. Unavailable product com.lephco.zombieshooter.luckyfind.3usd -com.lephco.zombieshooter.luckyfind.3usd
    4. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    5.  
    6.  
    7. Unavailable product com.lephco.zombieshooter.survivalkit.5usd -com.lephco.zombieshooter.survivalkit.5usd
    8. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    9.  
    10.  
    11. Unavailable product com.lephco.zombieshooter.prepperpack.10usd -com.lephco.zombieshooter.prepperpack.10usd
    12. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    13.  
    14.  
    15. Unavailable product com.lephco.zombieshooter.survivalistcache.20usd -com.lephco.zombieshooter.survivalistcache.20usd
    16. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    17.  
    18.  
    19. Unavailable product com.lephco.zombieshooter.survivalexpert.50usd -com.lephco.zombieshooter.survivalexpert.50usd
    20. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    21.  
    22.  
    23. Unavailable product com.lephco.zombieshooter.capitalist.100usd -com.lephco.zombieshooter.capitalist.100usd
    24. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    25.  
    26.  
    27. Unavailable product com.lephco.zombieshooter.foundwallet.3usd -com.lephco.zombieshooter.foundwallet.3usd
    28. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    29.  
    30.  
    31. Unavailable product com.lephco.zombieshooter.cashbox.5usd -com.lephco.zombieshooter.cashbox.5usd
    32. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    33.  
    34.  
    35. Unavailable product com.lephco.zombieshooter.safebox.10usd -com.lephco.zombieshooter.safebox.10usd
    36. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    37.  
    38.  
    39. Unavailable product com.lephco.zombieshooter.cashcrate.20usd -com.lephco.zombieshooter.cashcrate.20usd
    40. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    41.  
    42. OnInitializeFailed InitializationFailureReason:NoProductsAvailable
    43. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    44.  
    45.  
    46. 'KILL DEAD.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ninput.dll'. Cannot find or open the PDB file.
    47. Current item id: IN_MENU_INTRO_PLOT
    48. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    49.  
    50.  
    51. SETTING MESSAGE: Failed military experiment unleashed a global catastrophe - a deadly biological weapon that turned nearly all of humanity into bloodthirsty creatures.  currentstep ID: IN_MENU_INTRO_PLOT
    52. (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 40)
    53.  
    54.  
    55. The thread 0x365c has exited with code 0 (0x0).
    56. The thread 0x3e08 has exited with code 0 (0x0).

    My app is live on the Windows Store, just recently like 2 days ago it passed certification, and all IAPs are live, at least that's what the Dev Center says, and they don't work.

    Here's the code I'm using for initialization:
    Code (CSharp):
    1.    public void InitializePurchasing()
    2.     {
    3.         if (IsInitialized())
    4.         {      
    5.             return;
    6.         }
    7.  
    8.         var module = StandardPurchasingModule.Instance();
    9.         module.useMockBillingSystem = false; // Microsoft
    10.         var builder = ConfigurationBuilder.Instance(module);
    11.  
    12.        // var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    13.        // StandardPurchasingModule.Instance()
    14.        // builder.Configure<IMicrosoftConfiguration>().useMockBillingSystem = true;
    15.         foreach (IAPItem ia in IAPManager.GoldItems)
    16.         {
    17.             Debug.Log("IAP init id" + ia.ID);
    18.             builder.AddProduct(ia.ID, ProductType.Consumable);
    19.         }
    20.         foreach (IAPItem ia in IAPManager.CashItems)
    21.         {
    22.             Debug.Log("IAP init id" + ia.ID);
    23.             builder.AddProduct(ia.ID, ProductType.Consumable);
    24.         }
    25.        
    26.         UnityPurchasing.Initialize(this, builder);
    27.     }
     
  8. zuanzike

    zuanzike

    Joined:
    Sep 20, 2011
    Posts:
    20
    cool,I wait for this long time
     
  9. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @milox88 Do your product IDs exactly match, eg "com.lephco.zombieshooter.luckyfind.3usd"?
     
  10. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
  11. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @milox88 Do you have the internet capability set on your app manifest?

    If so can you please file a support ticket with Microsoft asking -

    Code (CSharp):
    1. ListingInformation result = await currentApp.LoadListingInformationAsync();
    2. result.ProductListings.Count; // Why are the product listings empty?
    This issue appears to be affecting my test app at present, too.
     
  12. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    @Banderous

    Yup, I have that capability set. I've already filed support ticket with Unity and Microsoft as well.
     
  13. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    @Banderous

    I'm very interested in Amazon IAP getting added. My cross-platform game is ready to go except for the IAP and I was planning on releasing on Amazon first.
     
    MrEsquire likes this.
  14. Erikoinen

    Erikoinen

    Joined:
    Nov 10, 2014
    Posts:
    68
    I keep getting NoProductsAvailable on iOS as well, and can't understand why. I have a very similar implementation than @milox88 and have set up the iTunes Connect part correctly.

    It's correct to set the identifiers like this, right?
    Code (CSharp):
    1. private static string kFullVersion = "fullversionIAP";
    2. private static string kProductNameAppleNonConsumable = "com.monkeyrama.fullversion";
    I have version 1.2 live which doesn't have IAPs, and am currently developing 1.3 which I've added the IAP for. Can that affect?

    Any help appreciated, thanks. @Banderous ? :)
     
  15. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Are they not releasing Amazon as they waiting for Amazon to pay them and make deal with Unity.. Not sure what the problem is? There are 10 dollar assets on asset store that support Amazon
     
  16. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Erikoinen Does com.monkeyrama.fullversion exactly match your product's identifier in itunes connect? Have you signed into the app store with a test account?

    You might want to follow this checklist
     
  17. monremobile

    monremobile

    Joined:
    Sep 16, 2015
    Posts:
    10
    Could you please provide a simple JS example of how to initialize the shop?

    Using JS examples from docs I'm getting "InvalidCastException: Cannot cast from source type to destination type." when calling... UnityPurchasing.Initialize(this, builder);

    It seems that the IStoreListener hasn't been assigned correctly.
     
  18. Erikoinen

    Erikoinen

    Joined:
    Nov 10, 2014
    Posts:
    68
    @Banderous I finally figured out what was wrong... I had uploaded a screenshot for my IAP in iTunes Connect, and therefore it wasn't found in the test environment. I re-did the IAP without a screenshot and everything worked fine.

    I had followed dozens of checklists and whatnot to make everything is fine, but couldn't really pinpoint the issue to the actual issue: don't add a screenshot to your IAP before you're ready to submit to Apple. Sigh.