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
    @PixelEnvision correct, Unibill will report nothing unless configured to.

    As it happens 1.5.0 has gone live prematurely before the analytics site is live.
     
  2. RnR Corp

    RnR Corp

    Joined:
    May 17, 2014
    Posts:
    3
    I Dont know why "Item Already Owned".
    Test in Android.
    and test item is consumable.

    please help me
     
  3. RnR Corp

    RnR Corp

    Joined:
    May 17, 2014
    Posts:
    3
    and.
    How to get orderid in android?
     
  4. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @RnR corp make sure you're on the latest version.

    What do you mean by orderid?
     
  5. RnR Corp

    RnR Corp

    Joined:
    May 17, 2014
    Posts:
    3
    i use 1.5.0.
    orderis is google wallet order id.
     
  6. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    It should be in the receipt that unibill provides on the purchase event. Take a look at Google's docs for the receipt structure.
     
  7. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Unibill 1.5.2 is now available, featuring Unibill Analytics!

    Unibill Analytics provides free revenue and installation metrics for your App, giving you accurate net revenue figures across all Unibill platforms.

    This is fully integrated into Unibill with no coding required!
     
  8. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    I need to build with Eclipse in order to integrate a third party library and I got this error related to a png of res folder:

    Found duplicate file for APK: res/drawable/dialog_full_holo_light.9.png

    Do you know how to fix it? I started to get this error adding the .jar libraries and res of Unibill to my Android folder before exporting it as Android project.
    Thank you in advance for your help!
     
  9. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Just wanted to confirm that when you say UniBill is "distributed as source", that includes source to the native portions, specifically the eclipse (or whatever) source for the Android JAR, and the ObjC source for the iOS integration? We don't want to compile it every time, but we've had issues with other plugins that don't include this source, without which debugging is a royal pain.

    Alex
     
  10. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    If you are not building for Samsung In-App billing you may completely remove the res folder as it's there as a part of Samsung SDK. Otherwise I think you may safely delete that single file as it's available somewhere else in your project.
     
  11. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Last edited: Sep 4, 2014
  12. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Perfect. As long as it's possible to get the source that's great.
     
  13. warlic

    warlic

    Joined:
    Apr 24, 2013
    Posts:
    2
    I am currently trying to get restore purchases working for Unibiller for Amazon App Store and the AmazonSDKTester. We need receipts on restore purchases for server-side verification purposes. However, when restoring purchase from a fresh install of the game, the purchase event from Unibiller comes back with an empty receipt.

    I noticed that Unibiller automatically restores purchases on launch, but these receipts are also empty. Calling GetAllPurchaseReceipts after restore just returns an empty string array.

    When the item is first purchased, the receipt is returned with no problems - it is only on restore purchases that the empty receipt is received. The interesting thing is that when I run 'adb logcat -s AmazonSDKTester' - I can see the purchase receipts in the AmazonTester's responses to Unibiller.

    I am using the latest version of Unibill from the Assset Store.
     
    Last edited: May 21, 2014
  14. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @warlic The lack of receipts on Amazon restore was an oversight, now fixed along with another Amazon race condition when restoring purchases on a first install. Contact support@outlinegames.com with your purchase receipt for a unity package.

    Out of interest, are you offering downloadable content? If so how are you hosting it?
     
    Last edited: Sep 4, 2014
  15. warlic

    warlic

    Joined:
    Apr 24, 2013
    Posts:
    2
    @Banderous Wow! Thank you so much for your quick response. I will send you that information asap.

    In regard to your question about downloadable content: We are not currently offering any downloadable content in our mobile games. However, in our web-based games we usually host downloadable content through an external CDN network (I forget which one...)- We will probably do something similar if we start offering downloadables in our mobile games.
     
  16. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    What about Proguard?

    I added this at my proguard project txt:

    -keep class com.outlinegames.** { *; }

    and the lines suggested here and here depending on the iap used.

    It's enough, is it right?
     
  17. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @silviobadseed for Samsung you'll also want com.sec.android.iap.*
     
  18. GiantGrey

    GiantGrey

    Joined:
    Jul 2, 2012
    Posts:
    266
    Hi Banderous,

    i have a question regarding managed, un-managed, consumable and non-consumable purchases.
    in your doc you write: "all the products that you create should be of type ‘managed’"
    and google says: Once purchased, a managed item cannot be purchased again until you consume the item
    i'm confused, and just want to make sure i understand that correctly. So even when i want to create In-Game Currency for my game that is of type consumable and the user can buy as many of this product as he want without first consuming it. In google i'll still have to create a managed type of product?
     
  19. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @propeller Unibill will make the consume call to Google for you when you declare it as consumable in the inventory editor, thus allowing repurchase.
     
  20. GiantGrey

    GiantGrey

    Joined:
    Jul 2, 2012
    Posts:
    266
    thank you for your quick answer!

    One more question :)
    I just tested my shop, and when i buy in game currency for let's say 10$ i should get 1000 Gold.
    After onPurchaseCompleteEvent i call Unibiller.GetCurrencyBalance("gold"); but it returns 0.
    Is this because i'm using a test account and Unibill does not actually count the purchase.
    Or do i have to manually add the gold with Unibiller.CreditBalance("gold", 1000); ?
     
  21. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @propeller have you looked at the demo scene? Unibill credits currencies automatically, you just need to set up the mappings in the inventory editor.
     
  22. GiantGrey

    GiantGrey

    Joined:
    Jul 2, 2012
    Posts:
    266
    aah my bad sorry! There were several mappings of the same kind... don't know why. Cleaned everything out, now it works! Thanks!
     
  23. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    Is there any way to have also purchaseToken and signature for a Google IAP purchase or token for a Amazon IAP purchase?
     
  24. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    The purchase event has a receipt property. That has all the details.
     
  25. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    Ok so it's a string to parse. But how can I parse it? I have simply to try and see how to parse it? There's no separation char or anything else that can help me to parse it depending on the store?
     
  26. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    It is json. The schema depends on each platform for which you should consult each platforms receipt validation guide.
     
  27. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    So, just to be clear, if I use code like this inspired by yours:

    Dictionary<string, object> response = (Dictionary<string, object>)Unibill.Impl.MiniJSON.jsonDecode(json);

    I should find, accordingly for instance to this, a field "orderId" or "purchaseToken" or I think "signature" with relative values, isn't it?
     
  28. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Yes, although why would you be parsing receipts from within your app?
     
  29. BarneyW

    BarneyW

    Joined:
    May 29, 2014
    Posts:
    4
    Hi,

    A question mostly for Banderous but I'd welcome suggestions from anyone.

    I have just started playing around with Unibill and so far so good. I have seen the possibility of adding products at runtime mentioned a few times and it was suggested it was rather straightforward but I haven't seen any actual examples. I was wondering if there is a recommended approach to doing this that won't trip me up further down the line? I was planning to add a call to add items to the list of PurchasableItems in UnibillConfiguration before initialisation or should I be injecting them elsewhere?

    Additionally my store will have items that can be bought for virtual currency and I would was planning to add these at the same point and in the same way as I would like the process of purchasing to follow the same code path as much as possible. I'm assuming this shouldn't be a problem since these sort of items can already be added through the inventory editor? (We are not using the Unibill VC system as we have our own system for syncing this with a server).
     
  30. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    UniBill features the 'hosted' config option in the inventory editor. Put in a URL, and UniBill will fetch it on startup and use it on next boot.

    So you should host your inventory json at that URL. Note there is a latency of one app cycle before the new config is used.
     
  31. BarneyW

    BarneyW

    Joined:
    May 29, 2014
    Posts:
    4
    Thanks Banderous. For various reasons I couldn't use the hosted config stuff as is but this definitely set me off in the right direction, stopped me going the long way round.
     
  32. concave

    concave

    Joined:
    Aug 28, 2012
    Posts:
    49
    my game worked perfectly when i tested it the last time - now i get this error all the time!

    GOOGLEPLAY_NO_PRODUCTS_RETURNED
    Google Play did not return any of your products as available for purchase, so no purchases can be made.
    • Make sure your App’s bundle identifier matches the bundle identifier in the Google Play publisher console.
    • Make sure your App’s version code matches the version code in the Google Play publisher console.
    • Make sure your App is signed with a release key.
    • On the device, make sure you have accepted the latest Google Play terms of service; open the Google Play App and accept any terms of services that are presented.

      ^ i double checked the conditions above - and there was no change -


      The following method is where i send my ids to the store and only if the match i will get a positive result right?

      queryInventoryAsync(final boolean querySkuDetails,
      final List<String> moreSkus,
      final QueryInventoryFinishedListener listener, final long delay)


      Logcat gives me this:

      I/Unibill (25372): onIabSetupFinished: 0
      I/Unibill (25372): Requesting 5 products
      I/Unibill (25372): QueryInventory: 5

      D/Finsky (23852): [8] InAppBillingUtils.getPreferredAccount: some bundle identifier: Account from first account - [some string]

      I/Unibill (25372): onQueryInventoryFinished: true
      I/Unibill (25372): Inventory refresh successful. (response: 0:OK)
      I/Unibill (25372): PollForConsumables

      D/Finsky (23852): [8] InAppBillingUtils.getPreferredAccount: some bundle identifier: Account from first account - [some string]

      I/Unibill (25372): onQueryInventoryFinished
      E/Unity (25372): UnibillBiller: Google Play returned no products as available for purchase. Have you defined your purchasable items in the Google Play publisher console?.
      E/Unity (25372): See http://www.outlinegames.com/unibillerrors#GOOGLEPLAY_NO_PRODUCTS_RETURNED



      do you have an idea why this happens?

     
    Last edited: Jun 3, 2014
  33. duffyrobert47

    duffyrobert47

    Joined:
    Feb 26, 2014
    Posts:
    6
    yes, i'm having the same problem with GOOGLEPLAY_NO_PRODUCTS_RETURNED, i tried 2 days, but found no problem with my code, don't know why, can u double check ur plugin?
     
  34. rs_sd

    rs_sd

    Joined:
    Jun 6, 2013
    Posts:
    1
    I am troubled by GOOGLEPLAY_NO_PRODUCTS_RETURNED, too.

    I want to know a solution early.
     
  35. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
  36. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    I am facing a problem with Windows Store builds. The test scene for Unibill, which shows the products and currencies using the Unity GUI gives me the following error in the developer console:

    A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?


    Unity does not tell me which script is the problem (unless that is an update of Unity 4.5, which I'm not using yet) and I found another thread in which the user concluded that the problem came from Unibill (last post in http://forum.unity3d.com/threads/system-serializableattribute-conf-predefines-cs.239766/).

    Can you tell me how can I solve this issue?
     
  37. dchau_hh

    dchau_hh

    Joined:
    Jan 22, 2014
    Posts:
    24
    You need to fully publish your app as Alpha...
    Then wait for it to become available in the Play Store...
    And then still wait some indeterminate amount of time longer before the IAP will become available again (it was around 2 hours for me)
     
  38. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Since today, I have the same problem. I haven't changed anything, but suddenly I always get the error GOOGLEPLAY_NO_PRODUCTS_RETURNED.

    What do you mean by "fully publish your app as Alpha"?
    In the Google Play Developer Console, I select my App, then under "APK", I have uploaded an .apk (correct bundle id, correkt version, signed) for BETA TESTING. If my APK is there, is that fully published as Beta? Or do I overlook something?
     
  39. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Sorry for the delay in responding to these messages, the new forums have not been sending me emails.

    Yes, as has been stated Google recently made a change that means you can no longer test your IAPs using a draft, unpublished version of your App.

    Google's new process is unintuitive and all rather unfortunate.

    You must:

    1. Upload a signed APK as an Alpha or Beta
    2. *Publish* the app by clicking on the publish button in the top right of the console. This will not publish it publicly unless you have defined a public APK.
    3. Create a Google+ group, inviting your test user account to join it.
    4 Invite your Google+ group to your Alpha or Beta from the publisher console
    5. Wait (it took 24 hours for me)
    6. You should now be able to sideload your APK onto your test device and have it initialise. Alternatively install it from the link in the publisher console.
     
  40. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @CanisLupus as discussed, you need to target 8.1 and not 8.0
     
  41. KristianDoyle

    KristianDoyle

    Joined:
    Feb 3, 2009
    Posts:
    63
    I'm trying to test restore purchase in iOS sandbox, but seem to be getting successful restores when the test user hasn't purchased.

    // following is called after Unibiller.restoreTransactions()

    private void onTransactionRestored(bool success)
    {
    if (success) // I'm getting a value of true here, even when the test user hasn't purchased.
    else //
    }
     
  42. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    onTransactionRestored simply indicates that the restore processed has finished.

    If a purchased item was restored, the purchase event would fire during that process.
     
  43. KristianDoyle

    KristianDoyle

    Joined:
    Feb 3, 2009
    Posts:
    63
    Yep - thanks !
     
  44. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    Sorry Banderous for the late answer, anyway I need to parse the receipt because I have to send a report of the IAP completed to a native sdk of our publisher who want to know sku, orderId, purchaseToken and signature separated and not aggregated in one string.
     
  45. silviobadseed

    silviobadseed

    Joined:
    Nov 28, 2013
    Posts:
    32
    Banderous I got an error on WP8 but I thought it was caused by Unity so I opened a post here but they suggest me to do an hack because the callback seems to be handeld wrongly on another thread. I don't know if you know what is about and maybe it can help you for a fix on an update of Unibill, anyway I thought you might be interested....
     
  46. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I'll take a look when I get back.
     
  47. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    Hello Unibill

    I was able to make my Google Play in app purchases work. I'm glad that it's easy to use. I do have a problem with Initialize() though. It is stated that it should only be called once and usually on game load which I did. My in-app screen is disabled until onBillerReady is triggered. Here's a case:

    - device is not connected (wifi and data is turned off)
    - player goes to in-app screen but finds it closed (disabled) due to no connection
    - player turns on wifi or data
    - but in-app screen is still closed (onBillerReady is not triggered)

    What's happening is onBillerReady is not triggered for cases where there's no connection when the app was launched. I've observed in logcat that Unibill is always trying to connect at some interval. When it does get a connection, somehow onBillerReady is not triggered in this case.
    Am I missing something? Should I invoke Unibiller.Initialize() again for this?
     
  48. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @davenirline Unibill will initialise eventually in such a scenario. If there's a specific scenario where this fails send a trace from device to the support email.
     
  49. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @silviobadseed Unibill fires its events on the main UI thread, so you should be able to call any UnityEngine methods from your callback. I can't reproduce your problem.
     
  50. Landci

    Landci

    Joined:
    Aug 28, 2012
    Posts:
    33
    Hello, i am very satisfied with your software, was real a chram integrating the in-app purchases!!Love it.

    One Question though, what happens to the currency when I update my Game? Will it stay untouched or will it be resetted to 0 ?

    thanks