1. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
  2. We're running a survey about the usage of our graphics pipeline, help give us your feedback.
  3. Unity 5.6 beta is now available for download.
  4. Unity 5.5 is now released.
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
  6. Enter the Google Play Indie Games Contest in Europe. Read more about it here.
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.

Announcement: Codeless IAP for Unity IAP

Discussion in 'Unity IAP' started by nicholasr, Nov 28, 2016.

  1. nicholasr

    nicholasr

    Unity Technologies

    Joined:
    Aug 15, 2015
    Messages:
    77
    Please see the Codeless IAP Manual, now live on the Unity Documentation site.

    Overview


    What is Codeless IAP?


    Codeless IAP is the easiest way to integrate in-app purchases in your Unity app. This allows you to use Unity's GUI and avoid directly using the Unity IAP API for a basic IAP integration.

    How do I use Codeless IAP?

    Add IAP Buttons to your app and define your products in the IAP Catalog. When players run your game, the Unity Purchasing system is configured based on the products you entered in the catalog. When a player taps or clicks on an IAP Button, it initiates a purchase of the associated product.

    Screenshots

    [​IMG]
    Inspector for a Button decorated with the Codeless IAP component


    [​IMG]
    IAP Catalog editor for defining and exporting Products​

    (edit: link to Unity Documentation site for additional details, truncate this post to 'overview' only)
     
    Last edited: Dec 8, 2016
    Sonic19990 and PedroGV like this.
  2. Robiwan

    Robiwan

    Joined:
    Dec 29, 2013
    Messages:
    77
    Thanks for this, and perfect timing for me as I'm about to integrate IAPs in my project and have limited code skills :)
     
    nathanf-unity, nicholasr and erika_d like this.
  3. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Messages:
    63
    how can i set up different ids for a few apk bundles?
     
  4. nathanf-unity

    nathanf-unity

    Unity Technologies

    Joined:
    Sep 30, 2016
    Messages:
    3
    We do not currently have any support for that, but we are always interested in collecting feedback about which features are important to put on our roadmap. Would you mind sharing a little about your workflow and why you want to set up different ids for different APKs?

    If you want to try to work around the lack of support right now, you could try working with multiple catalog files. The catalog is currently serialized as JSON and saved inside the plugin directory, in Assets/Plugins/UnityPurchasing/Resources/IAPProductCatalog.json. You could copy that file or create multiple product catalogs. You could then set up your build process to change which catalog file is included in your APK, or you could include all the catalogs and change IAPButton.cs to load from a different path at runtime.
     
    erika_d and nicholasr like this.
  5. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Messages:
    63
    Hi! Thanks for support. My english is terrable .. so ..

    we have a few apk's in google play for different publishers.
    e.t.c amazon does not allow multiple using iap bundle in one account.
    that's why our iap bundles contains apk bundle name
    for example if apk bundle named
    com.company.game1 and com.company.game2
    iap bundles named com.company.game1.gold_100 and com.company.game2.gold_100

    for example 3 similar apps for different publishers
    https://play.google.com/store/apps/details?id=com.foranj.cartooncity
    https://play.google.com/store/apps/details?id=com.foranj.cartooncity_kor
    https://play.google.com/store/apps/details?id=com.foranj.citybuilder

    all bundles can be different, iap bundles can be different.
    now we are resolve it by our bundle manager that solving our problems

    but codeless iap plugin is not finalized and functionality too poor.

    Sory, but new version is not usable :(

    PS I love Unity.
    PPS Need smile "Love Unity"
     
    Last edited: Nov 30, 2016
  6. nathanf-unity

    nathanf-unity

    Unity Technologies

    Joined:
    Sep 30, 2016
    Messages:
    3
    Thank you for sharing your feedback. For your situation it sounds like Codeless IAP does not provide all the functionality you need, so you should continue to use the regular API. The existing API is not going away, and we expect many developers will choose not to use the Codeless IAP tools.
     
    Garth-Smith and nicholasr like this.
  7. PedroGV

    PedroGV

    Joined:
    Nov 1, 2010
    Messages:
    295
    This is great! Are you planning to add a service to handle cross-platform UserIds so that purchases can be used in different platforms for the same gamer? (I'm referring about the logic even if we have to use our own backend) Example: say you have an iPhone, an Android-based tablet and a PC with steam installed, and the game is available for all those stores and platforms and we want to share your IAPs among those three platforms/devices.
     
  8. CH-M

    CH-M

    Joined:
    Feb 12, 2014
    Messages:
    5
    Thanks, This is great , can you add Fortumo
     
  9. MardukCorp

    MardukCorp

    Joined:
    May 21, 2016
    Messages:
    12
    Does this replace the current IAP Service, is it better than the current IAP Service or is it just an alternative for people who don't have much coding knowledge?
     
  10. breban1

    breban1

    Joined:
    Jun 7, 2016
    Messages:
    49
    Does this codeless API include receipt verification, or is that still a manual process?
     
  11. nathanf-unity

    nathanf-unity

    Unity Technologies

    Joined:
    Sep 30, 2016
    Messages:
    3
    Codeless IAP does not replace the existing service—it is built on top of the existing service and intended to help developers who have less coding experience get started with IAP integration.
     
    nicholasr likes this.
  12. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Messages:
    63
    Do not close API functionality please, and make it feature loadable, outside of inapp plugin.
     
  13. arkon

    arkon

    Joined:
    Jun 27, 2011
    Messages:
    982
    Hi, I don't use the unity GUI, I use NGUI instead. Is it still possible to use the code less IAP with NGUI?

    Also you say you don't implement non consumable restoration on apples App Store, Apple will reject any app that doesn't allow you to restore purchases. How do you solve this problem?
     
    Last edited: Dec 1, 2016
    Fronne likes this.
  14. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Messages:
    1,838
    Just use the regular API...
     
    nicholasr and Fronne like this.
  15. Robiwan

    Robiwan

    Joined:
    Dec 29, 2013
    Messages:
    77
    Hi, just read the announcement of the release Unity 5.5, which also mentions Codeless IAP. Does this means that Codeless IAP is only included in unity and 5.5? Or is it available for previous versions as well?
     
  16. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Messages:
    63
    got it in unity 5.4.2 when update IAP plugin
     
    Robiwan likes this.
  17. Robiwan

    Robiwan

    Joined:
    Dec 29, 2013
    Messages:
    77
    Just got to do my first successful device on iOS from 5.4.3, super happy to finally make it work.

    However I have a huge request, that it think would be super helpful for others as well. I noticed that when I create the IAP button, it comes automatically with a text component. Could it be possible to post a script that fetches the name and price in local currency of the IAP and set that as the text component?

    Also a restore purchase script to drop on a button for restore purchase would also be very much appreciated.
     
  18. jhample

    jhample

    Joined:
    Jul 7, 2012
    Messages:
    41
    It does that already. There are Title, Description, and Price options on the object. Just attach them to the Text objects you want.
     
  19. Fronne

    Fronne

    Joined:
    Sep 25, 2014
    Messages:
    70
    I agree with Baroni, use the regular API to make sure Apple won't reject your App...

    Even better, use Baroni's Asset for IAP, this will save you countless hours of your time trying to reinvent the wheel...
    You can use it with Unity IAP wich is free and worked perfect for me. It also supports other Billing Plugins...
    I implemented this Asset in just a few hours, don't mess with IAP yourself just to save a few bucks if you don't know exactly what you are doing, using a professional Asset like Simple IAP System will guarantee satisfied costumers...
     
    Baroni and nicholasr like this.
  20. arkon

    arkon

    Joined:
    Jun 27, 2011
    Messages:
    982
    I know you can use the regular API, but my point is whats the point of touting a code less IAP implementation if it can't create an IAP solution that will pass basic Apple guidelines. Currently if you use this IAP method you will get rejected by apple because they insist on a restore purchases option. This Code less option is basically useless, so why are Unity suggesting it's a solution to the IAP problem?
     
    Fronne likes this.
  21. 009

    009

    Joined:
    Nov 7, 2013
    Messages:
    8
    I would like to know how do I get the price value that I'm already set on the Google Store ?
    It get nothing when I build on phone (But the button is working just the Price / Title /Description Text get nothing)
    What I set in the IAP catalog will shown up in editor play mode but not in the phone.
    Of-course the best way I want is directly get from the google play console

    Thank You
     
  22. 009

    009

    Joined:
    Nov 7, 2013
    Messages:
    8
    Okay............ is working but not on the first time ?? It works after I reactivate it....... Is a bug or?
     
    Last edited: Dec 16, 2016
  23. AVataRR616

    AVataRR616

    Joined:
    Feb 27, 2013
    Messages:
    14
    Hii,

    It seems the codless IAP framework doesn't automatically restore Android purchases. I got the impression from all my reading that it did. Is there a tickbox that I am missing? Or will I need to go back and re-implement some kind of store manager in code?
     
  24. AVataRR616

    AVataRR616

    Joined:
    Feb 27, 2013
    Messages:
    14
    Ah nevermind. It automatically went back up as soon as I loaded my store scene. Is this activated by the IAP purchase buttons?
     
  25. AVataRR616

    AVataRR616

    Joined:
    Feb 27, 2013
    Messages:
    14
    Yep it does!
     
  26. NelepovDS

    NelepovDS

    Joined:
    Nov 2, 2016
    Messages:
    4
  27. APalomo

    APalomo

    Unity Technologies

    Joined:
    Aug 3, 2016
    Messages:
    237
    @NelepovDS

    What version of Unity and the IAP plugin are you using?

    Did you make any modifications to the IAPButton.cs file?
     
  28. NelepovDS

    NelepovDS

    Joined:
    Nov 2, 2016
    Messages:
    4
    Unity 5.5 (not beta)
    IAP latest version
    upload_2016-12-22_11-34-21.png

    Button setup
    upload_2016-12-22_11-36-0.png

    p.s. try do reimport. No effect.
     
  29. NelepovDS

    NelepovDS

    Joined:
    Nov 2, 2016
    Messages:
    4
    For now i just make copy IAPButton script in my assets and now it work. Will wait fixes.
     
  30. efonsecab

    efonsecab

    Joined:
    Mar 1, 2011
    Messages:
    31
    Does it still need store initialization code when deploying to the stores such as Google Play?
    Like this one? https://docs.unity3d.com/Manual/UnityIAPInitialization.html

    When deploying to HockeyApp should it show something such as the FakeStore?

    I have a small test which works ok in the editor (it's showing the FakeStore), but when deploying to Google Play (in Alpha) or to Hockey App, when pressing the purchase button nothing happens, and the purchase handles for failure is not raised either, again, the store is working ok in the editor for both complete and failure.

    Is there a minimum version of Android supported?
     
    Last edited: Dec 23, 2016
  31. K1mM

    K1mM

    Joined:
    Mar 5, 2015
    Messages:
    1
    Hello guys, I have small problem. When I add non consumable item, ad buy it in play mode. Than reset play mode it is not bought anymore. Is it only in play mode, or I have something bad configured?
    Thanks
     
  32. jsaade

    jsaade

    Joined:
    Nov 29, 2013
    Messages:
    5
    I am having a weird issue when using IAP Button.
    When the player enters the Store page for the first time the prices never show, if he closes the page and re-opens it, then everything is working correctly.
    It seems the Price Text is not being being refreshed? Is there a way to force that behaviour?