Search Unity

Simple In-App Purchase System (SIS) - Shop solution

Discussion in 'Assets and Asset Store' started by Baroni, Aug 8, 2013.

?

Which billing plugin are you using in combination with Simple IAP System?

  1. Unity IAP

    65 vote(s)
    83.3%
  2. Voxel Busters

    4 vote(s)
    5.1%
  3. Stans Assets

    9 vote(s)
    11.5%
  4. Prime31

    0 vote(s)
    0.0%
  1. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Hello,
    I'm very interested in this plugin but I have some questions first:

    - Is it possible to create the item database with a separated tool, like excel or whatever and then load it as a regular asset in the asset folder?
    - If so, will it update in the editor version of item list creation?
    - How do you use this? Do you just create an empty object with this in your first scene and can you access everything from any scene after that?

    Thanks!

    fm.
     
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Hi fm,

    thanks for asking. The IAP list has to be set up in our IAP Settings editor in Unity (link to image). You will have to create the actual IAPs in Google Play or iTunes, our editor is just an interface for them.

    Could you please elaborate what you are trying to achieve with an additional asset file? There is the option to display store data for your products from Google or Apple on the device, instead of locally saved product data. This allows for description and price changes on the fly.

    Simple IAP System needs a billing plugin to work with. Our IAP Manager supports OpenIAB, Prime31, NeatPlug or Unibill plugins. Once you've imported both plugins, you have to place our IAP Manager prefab in the first scene of your game. After that you are free to customize one of our shop templates for displaying products your users can buy. We have a quick tutorial on our youtube channel (ReboundGamesTV) that shows how to create and buy a product with SIS.
     
  3. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Thanks for the prompt answer!
    Usually, you do your items list and cost in a spreadsheet so you can adjust the cost through calculations. You make all items relative to others or other factors so that when you insert or remove items or want to adjust the overall cost (Especially when you are prototyping and play testing) the data doesn't have to be changed by hand for everything.
    Then you load it in game to update your menues.
    That's why I'm asking it it is possible to have your tool load a csv file for example and automatically fill your menues in Unity.

    Fm.
     
    Last edited: Apr 22, 2014
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Thank you for your explanation, makes sense.You could still do your calculations in a spreadsheet, and copy paste them into our editor once you're satisfied with the result. I can see that this requires more time, but it really shouldn't take that long. Also if you're play testing with live data, you would have to adjust the items and prices in the app stores (e.g. Google Play), not in Unity. If you're only adjusting the price in Unity, but not in Google Play, your users would see the wrong price before buying the product - the data in Simple IAP System is just meant for labeling buttons and so on, but the actual data comes from the app stores.
     
  5. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Actually it doesn't work if you have many many many items you can buy with in game currency, like it's becoming common in Free to play games. As for real $ items, you are right it's not so much of a problem. It's a real issue for in game currency though.
     
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Ah right, bulks of virtual products... I'll see what I can do in an update!
     
  7. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Sounds awesome! There are some csv reader classes out there (Excel comma separated files) that can help you. And just an update button to your plugin ;)
    Looking forward to it. So should I buy your plugin or not... I'm still not sure :) :(
     
  8. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    It's your decision ;) The next update will likely restructure the item categories to be compatible with more platforms, especially when using OpenIAB (Android, iOS, WP8, Samsung etc.). That's a good time to bring in csv import. I don't want to promise a release date though (well, sometime within the next 1-2 months obviously).
     
  9. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Just bought it :)
    I guess I'll be busy enough figure out everything until the next update. Can't wait!
    Thanks listening to my input.

    Fm.
     
  10. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    Any possibility that you could add support for another payment plugin? The Reign plugins seem really nice, because you can use a single API to access a huge amount of native features on a bunch of different platforms.

    http://forum.unity3d.com/threads/203144-Reign-Unity-Plugins-(Win8-WP8-BB10-iOS-Android-ect-)/

    http://u3d.as/content/reign-studios/unified-native-android-api/5xu

    I prefer this over Unibill, because it supports more native features than just payment, and is even a little cheaper.

    Thanks,
    Jacob
     
    Last edited: Apr 23, 2014
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    @fmarkus
    Thank you! Let me know if you need further assistance.

    @uniphonic
    Unfortunately not, sorry. With OpenIAB being free this has been the last addition billing plugin wise. Supporting multiple billing plugins consumes a lot of time (I don't have at the moment) and I rather spend it on replacing NGUI with uGUI to reduce the complexity.
     
  12. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,257
    Please do not replace ngui.
     
  13. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    I understand. Thanks anyway! By the way, OpenIAB seems to be gone from the Asset Store, though it can still be found on GitHub.

    When you say uGUI, I'm guessing you're referring to the new Unity GUI. I don't know much about uGUI yet, but I hope you'll keep NGUI compatibility, since that's what I'm building my game around right now.

    Thanks!
    Jacob
     
  14. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Thanks, I've replaced the Asset Store links with GitHub.

    Yes, I mean the new Unity GUI. We're in the beta program and so far it looks promising... NGUI integration will still be available in SIS, but will eventually phase out at a later date. Thank you for your feedback!
     
  15. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    Is it possible to make a purchase in SIS, without fully loading the full store?

    For instance, if a user is in a game and runs out of an item, and we want to prompt the user to make a purchase while keeping the in game context, is this possible?

    Thanks!
    Jacob
     
  16. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Yes, just display a button to buy the product and let it call
    Code (csharp):
    1. IAPManager.PurchaseConsumableProduct(string productId) //or
    2. IAPManager.PurchaseNonconsumableProduct(string productId)
    When using OpenIAB it doesn't matter which one, they both do the same.

    For virtual products it would be
    Code (csharp):
    1. PurchaseConsumableVirtualProduct(string productId) //or
    2. PurchaseNonconsumableVirtualProduct(string productId)
     
  17. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    Great, thanks!

    Another question: Is it possible to tweak the cost of Virtual Products in live apps, without compiling and deploying a new app? If not, put that on the feature request list? :) It could be very useful to be able to tweak the in game economy. Maybe it could periodically check for a remote XML file (which would be hosted on one's own web server), which would contain pricing?

    Thanks!
    Jacob
     
  18. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Noted, thanks!
     
  19. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    In the example scenes, the scroll views for both of the "Menu" scenes (ListVerticalMenu and ListHorizontalMenu) have items that should scroll, but don't seem to (their Coins screens for example, should scroll). All other scroll views seem to be working properly. Any idea what could be happening? I have the latest version of NGUI.

    Thanks!
    Jacob
     
  20. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Thanks for noticing this! It seems that one of the newer NGUI versions changed how scroll views are affected by disabled sprites. The solution is to enable the "SlicedSprite" sprite in each menu (e.g. Window - Coins > Panel (Window) > SlicedSprite) and set its alpha near zero (1). I'll check if there's a better way to do this.
     
  21. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Hi!
    Just downloaded everything for a quick test. I have NGUI latest and your plugin's latest. When I run the 'All selection' scene, I get a script missing in OpenIABEventManager and can't see any virtual currency items in any of the examples.
    Is this normal?
    Cheers,

    fm.
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    I could not reproduce the missing script issue on my end. Are you sure that you've imported all plugins in the correct order, without opening the scenes?

    -NGUI ( 3.5.8 )
    -Simple IAP System ( 2.0.2 )
    -OpenIAB ( 0.9.6 )
     
  23. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    I will restart from scratch and make sure it's in that order. :)
     
  24. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    I don't get compilation errors if I follow the instructions on the pdf: Simple IAP, then NGUI, then open IAB pop but then also go to openIAB Gitub and get version 0.9.6. I would Not have figured that out because the latest says IAB-NOKIA... and I was looking of IAB Unity... confusing to me.

    Now, when I run the main scene, I get this error message:
    IAPManager: Detected non-mobile platform. Shop initialization will
    throw errors or won't initialize at all. Please switch to iOS/Android.
    UnityEngine.Debug:LogWarning(Object)
    SIS.IAPManager:Awake() (at Assets/SIS/Scripts/IAPManager.cs:135)

    Does this mean I can not run the examples or the plugin without having real $$$ store setup on iOS? Nothing shows up in the virtual currency tabs...
     
  25. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    This means that you should switch the deployment target to iOS or Android, so that OpenIAB can initialize properly.
     
  26. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Thanks for your help! I figured that out but does it mean I can not deploy this for web browser or pc/mac if I only have virtual currency?
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Good question! Technically the IAP Manager and database implementation are not bound to mobile devices, but the initialization of the billing plugin will fail when not running on a mobile device. This won't limit the functionality that SIS provides though, besides buying actual in-app products (for money). Honestly I haven't tested it in-depth on non-mobile platforms with virtual currency only...

    If you're still having issues with the example scenes and virtual currency not appearing (on mobile), please let me know. I'm not sure why that would happen, but if you could send me your invoice no. I'll send you my project.
     
  28. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Everything works when I set the build for mobile. I'm just worried about web browser...
     
  29. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,257
    @Baroni

    Could you please also update the download file for the people who bought this outside of the asset store?
     
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Sorry for the delay, we've switched our store provider a few days ago and are setting up customer notifications. I didn't announce the latest version yet, because it only contains changes to the example scenes, meaning there isn't much need to upgrade. You will receive an email with your new download link in the coming hours.
     
  31. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    OpenIAB doesn't mention the iOS App Store anywhere on the GitHub site, it only talks about Android marketplaces... But you said you tested OpenIAB with the iOS App Store.

    Can you provide detailed instructions on how to get Simple IAP working with OpenIAB for the iOS App Store? Thank you very much!
     
  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Yes, our OpenIAB implementation supports Google Play and the iOS App Store out of the box.

    On our YouTube channel (ReboundGamesTV) you'll find a tutorial for OpenIAB + Google Play and one for Unibill + iOS, uploaded today. I recommend watching both of these videos. The instructions in the Unibill + iOS video are not that different from OpenIAB, besides skipping Unibill's Inventory Editor. If you're deploying to Android with OpenIAB already, it would be the same process for iOS.

    Could you please explain the steps you're having issues with?
     
  33. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Just a quick follow up on this matter: web players do not support .NET file access. This is being used in Simple IAP System for storing purchases, currency, selected items and other player data as a JSON file. You would have to use a login system and database on your webserver instead, which is out of scope for this asset. I'll be working on standalone compatibility (virtual currency + purchases only) for one of the next releases.
     
  34. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
    I use UNIBILL.
    If I use SIS.
    It is ok in unity site.
    But if I use android device, there is no process, if I click button, there is no popup on the screen.
    Do you have any suggestion where I add some contents.
    I think billing system is not connected to mobile, when I build unity file.
     
  35. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Please add or check your in-app products in Unibill's Inventory Editor. You have to generate an AndroidManifest.xml file by selecting the Android target there (Amazon or Google Play). Also, there is a field for your Google Developer key.

    After you've done that, open our IAP Settings Editor (Window > Simple IAP Settings > IAP Settings) and import your Unibill items there by clicking the "Import Unibill Items" button.

    If Unibill does not initialize correctly on the device, please send me the error log from the device so I can take a look.
     
  36. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    That's cool. I hope I am not adding too much to your work :(
     
  37. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hi Baroni, I guess I'm trying to figure out how to connect your system to the game I'm making. I want to make a shooting game where the player can buy guns, bullets, and medikits. I can't seem to find where exactly SIS stores all the purchase information, such as number of medikits bought.

    I thought SIS had a basic inventory system that holds purchased goods but maybe not? Do I have to make my own inventory system? Do you have a tutorial that goes over virtual goods? Thanks!
     
  38. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Thanks for your explanation. SIS does not save player-related data without defining it explicitly. In the IAPListener script and its HandleSuccesfulPurchase method, which is being called after the user buys an item, you have to define what you want to save. You can use our database implementation for that and the documentation has a quick sample (page 17), e.g. for medikits:

    Code (csharp):
    1. //increment medikits by 5
    2. DBManager.IncrementPlayerData("medikits", 5);
    Then in your game code, where you want to display or get the current amount of medikits:

    Code (csharp):
    1. //get amount
    2. int medikits = DBManager.GetPlayerData("medikits").AsInt;
    In the IAPListener script you'll also find a sample for storing bullets.

    Edit: Decrementing medikits:
    Code (csharp):
    1. int medikits = ... //get value as seen above
    2. medikits--; //substracting one
    3. DBManager.SetPlayerData("medikits", new SimpleJSON.JSONData(medikits)); //overwriting
     
    Last edited: May 3, 2014
  39. mattSydney

    mattSydney

    Joined:
    Nov 10, 2011
    Posts:
    167
    Hi

    I wonder if you could help. The purchase of my non-consumble on IOS using Prime31 storekit seems to be working fine and it goes through the process and is successful, but it always returns an error of:

     
  40. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    The lines in your error does not match to my files, have you made any changes to the IAPManager?
    Also, what version of SIS and Prime31 StoreKit do you use and how could I reproduce this error (server verification turned on/off etc)?
     
  41. mattSydney

    mattSydney

    Joined:
    Nov 10, 2011
    Posts:
    167
    I will try reimporting the project then get back to you, thanks!
     
  42. mattSydney

    mattSydney

    Joined:
    Nov 10, 2011
    Posts:
    167
    I reimported everything and the error has gone, no idea what it was maybe I altered something. Anyway thank you for your fast response.I posted a good review to make up for wasting your time!
     
    Last edited: May 4, 2014
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Good to know. No problem, thank you very much for your review!
     
  44. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    So SIS keeps a local database that stores the IAP info, but updates from Google Play when it has an internet connection, correct? Is it possible for SIS to compare the price to it's local database, and when it's local database is more expensive than what it receives from Google Play, for it to put a "SALE!" flag on the product in the store? I'm trying to figure out a way to may periodic sales.

    Thanks!
    Jacob
     
  45. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Yes, that's correct.

    Google delivers the IAP price in the user's local currency, which means that would have to convert the local price to their currency in order to compare it. Usually the local price entered in SIS is just a placeholder. If you would like to show specific events when the device receives online data, OverwriteWithFetch() in the ShopManager script would be the best place to start. Note that this method is called once, and your user could not be in the shop scene (thus the sale should be stored in another static variable, per item).
     
  46. MattyMatt

    MattyMatt

    Joined:
    Oct 7, 2011
    Posts:
    21
    I'm converting my project for the web player and I'm getting a error that createdirectory overloaded function in simplejson doesn't exist . I tried enabling the csharpziplib define and adding that to my project but I think I'm barking up the wrong tree. Am I missing something ?
     
  47. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Please have a look at my post about webplayer compatibility. You could put a #if !UNITY_WEBPLAYER define in there to avoid calling the CreateDirectory method when deploying a webplayer.
     
  48. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    179
    Hi!
    Is there a way to change your source somehow, in the same manner you are describing a way to help on the Webplayer, to allow for iOS compiling before I got anything signed up with Apple Connect and only use Virtual In game currency?
    Cheers.
     
  49. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,266
    Hi there,

    well... yes, comment out the billing plugin initialization in IAPManager's Awake method.
     
  50. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    I'm getting an error:
    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,SIS.IAPObject].Add (System.String key, SIS.IAPObject value) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    SIS.IAPManager.InitIds () (at Assets/SIS/Scripts/IAPManager.cs:270)
    SIS.IAPManager.Awake () (at Assets/SIS/Scripts/IAPManager.cs:142)
    UnityEngine.Object:Instantiate(Object)
    SIS.ShopManager:Awake() (at Assets/SIS/Scripts/ShopManager.cs:87)

    Any idea what could be causing this?

    Thanks!
    Jacob

    EDIT: It seems that one of my IAP names conflicted with one of the example game content items ("energy"). Anyway, I fixed it by renaming things. You can disregard my last question. Thanks!
     
    Last edited: May 10, 2014