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

Introducing Unibill - the cross platform In App purchase plugin!

Discussion in 'Assets and Asset Store' started by Banderous, Jan 16, 2013.

  1. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I'd like to announce the release of Unibill; a cross platform approach to In App purchasing. It's a single plugin that works across the Apple App store, Mac App Store, Google Play and the Amazon App store!

    It’s the plugin I wish I could have bought for my own game development; a simple, clean and consistent interface that does all the heavy lifting, leaving you to get on with the bit that’s actually a game.

    But Unibill does much more than just let you buy stuff; it helps you through the entire integration process, with tools to help you bulk upload your purchase metadata to Apple and Google, and automatic integration with Amazon’s SDK tester.

    It also keeps a basic local database of what your users buy. It’s a plugin by someone who’s been through the gauntlet of pain, and put padding on all the sharp corners for you.

    Unibill is distributed in source form, with all unit tests.

    It’s available now on the Unibill website and the Asset Store - $125 for a plugin that replaces 4!

    http://www.outlinegames.com/unibill

    $reducedlogo.jpg
     
    Last edited: Jun 9, 2013
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Had a quick look through the blurb. Is there a way to be able to add to the product list at runtime? E.g. I may want to add items to my store via data once the app is released.
     
  3. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    That's not built in, but it would be easy enough to do so. You would need to fetch the updated UnibillInventory.xml file and store it locally, before initialising Unibill. You would then modify Unibill to look for this local file and use it in preference to the bundled version.

    Unibill is a source distribution, so you are free to change it as you like. I'm also happy to give you further pointers on any modifications you may require.
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I'm not keen on making changes to third-party plugins as I may run into problems when getting an update, plus I'm buying a plugin to save me work, not create it.

    As this is a feature that may be important to other users wouldn't it be better to have a nice clean way to do it? Something like a public method SetProductIds(string[] productIds)? Similar to how it's done with the Prime31 plugin.

    I already have all my product ids in json data files (along with other relevant data) which is used to set up data structures on startup. I can easily upload a new version on this file as required - well to be accurate, a bundle of all my files so that the download to the device is done as an atomic operation. I don't really want to maintain an xml file with duplicated data and deal with the other stuff you mentioned.
     
  5. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Product IDs may vary across the three different billing platforms. Unibill abstracts this by mapping platform specific product IDs to Unibill product IDs which do not vary across platforms.

    If you were to manage your own product IDs you would have to do so for each different platform, requesting the right set of product identifiers at startup and then, on receipt of a billing event, mapping them back to the same actual product.

    Unibill does this for you.
     
    Last edited: Jan 18, 2013
  6. Peter Gartside

    Peter Gartside

    Joined:
    Oct 23, 2012
    Posts:
    9
    Hi
    Just got your Unibill and it looks great :)
    I have just a couple of questions/problems when i integrated it into my project.

    1) I have a couple of prime 31 plugins that I'm using and when i try and do a build I have to reload the prime 31 plugins and do a full replace of the project to get it to work. If I just do a append it has removed the prime 31 plugins or the project just dosnt load at tall.

    2) If a do a transaction restore but i don't have anything to restore the onTransactionsRestored dosnt get called.

    Cheers
    Pete
     
  7. Peter Gartside

    Peter Gartside

    Joined:
    Oct 23, 2012
    Posts:
    9
    Plus in the inventory editor when you close it and reopen the Purchasable item Id always reverts to lower case, i have some items with capitals in and i have to reenter them every time i want to make a change.

    But apart from that every thing seems to be working nicely :)

    Cheers
    Pete
     
  8. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Which target platform is this - iOS or Android? When you say it has 'removed' the prime 31 plugins what exactly does this mean; are files being removed from your Assets folder? Which prime 31 plugins are these?

    Is this on an Android or iOS device or within the editor itself?

    Unibill converts all Unibill inventory ids to lowercase; why do you need mixed case identifiers? If you have mixed case identifiers registered with Apple or Google you can specify mixed case overridden identifiers for each platform in the inventory editor.

    Thanks for buying! Happy to help you with this, we can skype if necessary.
     
  9. Pete-Gartside

    Pete-Gartside

    Joined:
    Nov 28, 2012
    Posts:
    5
    Sorry for not stating the platform it was IOS. The prime 31 plugins stay in unity but when i build the xcode project it dosnt transfare the files across. It looks like it could be a conflict with the post build process when it building the xcode project.

    This again was on IOS but i will need it for Android as well, I did a quick mode to the code so even if it gets zero transactions it will still fire of the onTransactionsRestored call and then i check it on my side to see if there is anything to do.

    I needed this as i put up a message for the user telling them that i was checking as this could take some time over 3g, but if there wasn't anything to restore i didnt get a message back to tell me to take down the message.

    I do have mixed case ids with apple google and amazon, I have set the id's in the override to be mixed but it was still saving them out in lower case, I notes in the code the id's had a ToLowerInvariant on them and when i removed this it seemed to save out ok.

    This plugin has saved me weeks of work thanks loads :)

    Cheers
    Pete
     
  10. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Which Prime31 plugins are these?

    I am not able to reproduce the lack of a 'transactions restored' event; please can you send device logs to support@outlinegames.com.

    I have removed the toLowerInvariant from platform specific IDs.

    Thanks for the reports! Would you mind rating or giving us a review on the Asset store at some point? (Good or bad!)
     
    Last edited: Sep 4, 2014
  11. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I just picked this up.
    Is there a simple mod to implement a dummy generic billing interface for standalone use?
    Use case is I only have iOS/Android Basic, but I have Unity Pro main and need to test some AssetBundle functions with a mocked up payment cycle.
    The UniBill demo works ok in the editor but spits an error on build for standalone.

    ty!
     
  12. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Unibill comes with a fake billing service that is used within the editor; I have modified Unibill to use this implementation when running on standalone desktop targets, so your use case should now work.

    The latest version will take a couple of days to be approved by Unity. If you need it asap then contact support@outlinegames.com.
     
    Last edited: Sep 4, 2014
  13. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Thanks for the update!

    A couple of suggestions:
    More documentation on adding new custom billing services so to minimize changes downstream when updating UniBill. As pointed out @andymads this can be a pitfa in Unity so it's critical customisation is done properly.

    "The inventory editor tracks these purchasable items in an XML file located at Assets/Plugins/unibill/resources/unibillInventory.xml, which you can edit manually (or with your own tools) if you prefer."
    Again, due to updates possibly overwriting this file, it might be better to have a static UniBill configuration class where this file can be overridden with a user generated one.

    ty!
     
  14. Peter Gartside

    Peter Gartside

    Joined:
    Oct 23, 2012
    Posts:
    9
    I've sent you an email with the details


    This is only if i had no transactions to restore.
    On the IOS I had to change paymentQueueRestoreCompletedTransactionsFinished functions

    I've added the onTransactionsRestoredSuccess event in the section for queue.transactions count == 0 so i can tell when the restore is finished.

    I don't now were to change it for amazon or google play.

    Cheers :)


    Yep will do
     
  15. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Thanks for the suggestions. I have modified Unibill so that it does not include a static inventory XML file in the package, but instead will build it automatically if it does not exist. Thus Unibill updates will not overwrite any preconfigured inventory configuration.
     
  16. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    ah...I just updated the latest and it overwrote the unibillInventory.xml
    Glad I duplicated what I had just before update...
     
  17. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Hi, I'm facing an issue with 1.03. The IAP for iOS unable to retrieve the store items, even though SKU has been set.

    Also, how do I get the latest update? I bought it from you directly instead of AssetStore.
     
  18. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Please contact support@outlinegames.com with your order number to get the latest version.

    Re: unable to retrieve product details from iTunes connect, have you reviewed the Unibill help pages? Otherwise use the same email address for support queries.
     
    Last edited: Sep 4, 2014
  19. MartinW

    MartinW

    Joined:
    Feb 14, 2013
    Posts:
    14
    Cannot build, have the following errors (Unity 4.0.1) :

    Error building Player: Exception: dx (invokation failed)
    ERROR: unknown error
    cmd:dx --dex --verbose --output=bin/classes.dex bin/classes.jar plugins
    stdout;
    ....
    stderr:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/amazon/inapp/purchasing/BasePurchasingObserver;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:490)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
    at sun.reflect.NativeMeth
     
  20. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    This might be because you have two versions of the Amazon SDK Jar within your Assets folder.

    Is this a clean import of Unibill or did you upgrade Unibill to the latest version? The version of the Amazon SDK bundled with Unibill was recently changed, which might be the cause if you upgraded your installation.
     
  21. MartinW

    MartinW

    Joined:
    Feb 14, 2013
    Posts:
    14
    I tried with a new project and only importing Unibill, I get the same error. My system is:

    Windows 7
    Java SDK 6.41
    Unity 4.0.1

    Normally I can build and run Android apps, it seems that the problem is caused by Unibill.
     
  22. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I've just checked the Unibill Asset store package and Unity have included both versions of the Amazon SDK in the latest packaged version.

    @Ravklok please delete Assets/Plugins/Android/In-app-purchasing-1.0.5.jar.

    The latest update changed the bundled version from 1.0.5 to 1.0.3 but Unity have inexplicably included both versions in the final package.

    I have contacted Unity to correct their error, but in the meantime this will fix your compilation error.
     
    Last edited: Feb 28, 2013
  23. MartinW

    MartinW

    Joined:
    Feb 14, 2013
    Posts:
    14
    That was it! The demo now build and run without any error, thanks for the fast reply.
     
  24. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    No problem. For what it's worth, Unity have now fixed the Unibill Asset store package and are investigating how this happened.
     
  25. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    I have the same issue with Unibill and Prime31 plugins, seems that your post-processor is cancelling the Prime31 post-processor which copy their files to the XCode project. Can you fix this asap?
    Thanks!
     
  26. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    It's being worked on, I'm changing the way Unibill post processes the XCode project to avoid this. A fix will be available shortly.

    In the meantime you can work around the problem by commenting out the code in Assets/Editor/unibill/src/PostbuiltProcessor.cs.

    You will then need to manually add the storekit framework to your XCode project as described here.
     
  27. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @spartan The xcode modifications problems are now fixed. An updated package is pending Unity's approval, or you can send me your order number for an immediate update.
     
  28. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    I'm on Unity4.1 pro and keep getting errors when adding Items in the inventory editor.
    There are two issues.
    1. When adding a new item the header info is ok, but the GooglePlay /amazon/ios sections have nothing apart from id.
    So I fill the main details, then close the tab so I can reopen it. By reopening it the payment sections now have the rest of their details showing so I can add price etc.

    This works sometimes but for some random reason occasionally I can't reopen the inventory window, and have to kill unity and restart it to show it.

    ty!
     
  29. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @sonicviz An update that fixes this is pending Unity's approval. In the meantime you can contact support@outlinegames.com for an updated unitypackage for an immediate fix.
     
    Last edited: Sep 4, 2014
  30. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    I'm having a few problems:
    1. I imported the package and it says "global::" already has a definition for ComboBox which is found in the Script folder Unibill adds. I had to remove the folder completely but am not sure what that messes up?
    2. I tried to Save a single inventory item added for iOS and it throws 5 NULL reference exceptions in the CSV writer.
    3. I am trying to re-open the inventory window and now it says "Trying to focus orphaned EditorWindow
    UnityEditor.EditorWindow:GetWindow(Type)
    InventoryEditor:ShowWindow() (at Assets/Editor/unibill/src/InventoryEditor.cs:95)"
     
  31. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    This is used by the example scene that comes with Unibill. It won't affect Unibill itself but the sample scene won't work, so if you don't need the sample scene you're fine to delete this.

    You've hit the same problem as sonicviz. Please contact support@outlinegames.com for an immediate fix, the Asset store version is still pending Unity's approval.
     
    Last edited: Sep 4, 2014
  32. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    Yeah, I see that based on his description. Thanks for the quick reply.

    If I may, I suggest renaming ComboBox to something unique so it doesn't interfere with other projects in the future. Maybe UnibillComboBox or something.
     
  33. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Yes indeed thanks for the suggestion, ComboBox should be namespaced. That will happen shortly.

    In the meantime ping support@outlinegames.com for an updated unitypackage.
     
    Last edited: Sep 4, 2014
  34. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    This plugin is excellent. Any chance you'll do something similar for Facebook integration in the future?
     
  35. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Thanks! Yes, I have considered a facebook plugin. From my own experience there are a number of plugins that could use some cross platform unification. Whether they get made depends on the economics. I was surprised and disappointed when I discovered the vast array of platform specific plugins for seemingly simple tasks. After all, this is Unity, right?
     
  36. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    @Banderous,

    Sent you an email on March 27th with the transaction snippet to include it on the official release.
    When do you expect to release the plugin with Mac In-App purchase?
    Thanks!
     
  37. MiniPooks

    MiniPooks

    Joined:
    Apr 16, 2013
    Posts:
    2
    @Banderous

    This plugin looks really interesting, thanks for making in-app purchases cross-platform in a single solution! You mentioned in the support comments on your website that you were working on supporting receipt validation through an external server. Is that currently in progress and do you have an idea of when that would be available?
    Thanks!
     
  38. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I'm happy to announce that Mac In App purchase is now officially supported!

    Users who have already integrated with Unibill should be able to target the Mac App Store without writing a single line of extra code. All you need do is configure your product identifiers in the Inventory editor and iTunes connect, and follow the signing instructions on the Unibill website.
     
  39. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    To be clear, we will be exposing receipts through the Unibill interface so that you can verify them yourself. We will not actually perform receipt verification for you. Note that in our view, receipt verification is unnecessary and even undesirable, except in very specific situations - which is why Unibill does not do it for you behind the scenes already.

    This should be available next week.
     
  40. MiniPooks

    MiniPooks

    Joined:
    Apr 16, 2013
    Posts:
    2
    Yes, that was my understanding from the original message. Thanks for the prompt reply!
     
  41. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    Integration was super easy...

    At least, I think it was. I can't deploy to a device at the moment as I'm working from a PC and don't have an Android on hand, so I can't test on a device. When testing in the Editor it's behaving nicely as if I'd already made the in app purchase, but I can't find a way to mark the item as not having been purchased to test that code path. Is there a way to do that? Better yet, is there a way to fake the actual purchase in the Editor?

    I'm loving the plugin, though. I was dreading the task of implementing IAP after the pain of integrating multiple platform specific plugins for other features, but using Unibill has really made it quite straightforward.
     
  42. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Unibill remembers what you have purchased using PlayerPrefs. If you make a call to PlayerPrefs.DeleteAll() then all purchasable items should report as unpurchased.

    When running in the editor Unibill runs with a fake billing backend where purchases always succeed but should otherwise behave as a 'real' platform.
     
  43. eezSZI

    eezSZI

    Joined:
    Nov 16, 2012
    Posts:
    121
    So NOOK in-app purchases are now available. Any chance support will be added to Unibill?

    Looks like an awesome product btw, hope to use in on our next project!
     
  44. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    That rocks. :) Using that I had my code paths sorted in about 3 minutes, which is about how long it would have taken just to deploy to my iPad.

    It's not a big deal at all, but any chance of a way to reset purchase data without nerfing the rest of my PlayerPrefs? I'm sure it wouldn't take long to work out for myself should I really need it though.
     
  45. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Thanks for the suggestion! I've also had requests for Windows 8, Windows phone and Ouya. It's possible but I'm afraid I can't promise anything at the moment, I'm seeing how the economics of multi platform plugins stack up. Unibill may replace 4 different plugins but unfortunately I can only sell it once!
     
  46. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Glad to hear it's proving useful! I've been through the pain of integrating platform specific plugins that will only work 'on device'; almost all your time is spent waiting for code to get pushed down wires - agonising. It was a strong signal to me that there must be a better way.

    That's a great suggestion, it'd be hugely useful to be able to do that. I'll add it in!
     
  47. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    @Banderous I'm trying to test Amazon Store iap, but nothing happen when I try to Install Amazon Test client from Window -> Unibill -> Install Amazon Test client
    I'm using Unity for Mac
     
  48. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    "Install Amazon Test client" should install the Amazon SDK tester onto your connected device - have you connected your Android device with ADB debugging enabled?

    If it works you should see the Amazon SDK tester appear as an App on the device.
     
  49. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174

    Discovered the bug on Unibill, my project was on a folder with spaces, but Unibill is not adding slashes " "

    Replace line 133 from InventoryEditor.cs with this one:
    p.StartInfo.Arguments = string.Format("install \"{0}\"", apkPath);
     
  50. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    @Banderous
    I have detected a possible bug on Unibill. Having the inventory

    (the spaces on the code is because the forum will not show it correctly)

    for iOS
    Product 1:
    bundle identifier:
    for Mac:
    bundle identifier:
    On Mac App Store this will not work:
    I need to call it with the iOS bundle identifier:
    And it will open the Sandbox correctly with the Mac product: com.company.gamenamemac.product1


    Seems that the Mac App Store code of your plugin is mapped to the iOS Bundle identifier for the function Unibiller.initiatePurchase
     
    Last edited: Apr 26, 2013