Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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
    Thanks!

    Currency balances will be preserved when you update your game.
     
    PixelEnvision likes this.
  2. BarneyW

    BarneyW

    Joined:
    May 29, 2014
    Posts:
    4
    Hi Banderous,

    I wanted to report an issue similar to that reported by Dreamwriter a while back - the issue with not being able to buy a consumable item due to the "item already owned" message.

    My experience was something like this:

    Attempt to purchase item
    Eventually get on screen error from Google Play that "Connection timed out"
    onPurchaseCompleteEvent not called (as I would expect but I did not notice a cancel or fail either)
    Attempt to purchase again and got "item already owned" Google Play message

    So I did another build and added "restore purchases" after successful initialisation (my understanding is unibill will automatically consume any outstanding items at start up but since all Android IAPs are now managed I thought this might just kick start a way out of this problem). From my logs nothing seemed to be restored but attempts to purchase the item failed, presumably on some sort of Unibill side check as I never saw the Google Play UI. I couldn't find any info in the logs except my own log from within my onPurchaseFailed.

    Finally I reinstalled the app with another minor tweak* and reinstalled and this time the purchase worked.

    *I just added some checks I call in onBillerReady to onTransactionsRestored they just verify stuff with our server, they don't trigger any Unibill code so are possibly not relevant.

    Unfortunately I got interrupted after the "item already owned" message and by the time I got back to my work I found it difficult to say for certain if the store emails I got related to this or test purchases I made just before - I feel they were from earlier purchases i.e. I did not in fact own the item. So perhaps this is just an Android issue (I have seen a similar problem reported for another billing plugin) and it just needed some time to reconcile things in my account but obviously if Unibill could provide us with information to allow us to handle this gracefully we would appreciate that.

    I am on Unibill version 1.4.5
     
  3. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @BarneyW there is a known Google Play bug whereby an item can get into an 'owned' state, yet Google Play does not report it as owned, nor does it permit it to be consumed.

    The problem appears to be caused by the Google Play App's local cache, which can get out of sync with the 'real' state of a purchase on Google's side.

    This can be fixed by clearing the Google Play App's data cache, but this is not something Unibill can do.

    Edit - the problem will eventually resolve itself regardless, when Google Play resyncs its cache correctly.
     
  4. BarneyW

    BarneyW

    Joined:
    May 29, 2014
    Posts:
    4
    Ah okay, it felt like it may be something along those lines. Thanks for getting back so quick and thanks for the info.
     
  5. KristianDoyle

    KristianDoyle

    Joined:
    Feb 3, 2009
    Posts:
    63
    Just a quick question - is Unibill able to retrieve purchase receipt information for payed apps under iOS?

    Works great for In-App purchasing - just wondering if also possible to retrieve information about the initial App purchase.
     
  6. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @KristianDoyle The iOS 7+ App Receipt is not currently returned, rather the older transaction receipt. This will change in Unibill 1.6 though it isn't ready for release.

    You can modify Unibill's objective C implementation to return it fairly easily.
     
  7. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    Why is the "onPurchased" event being fired twice, every time I make a purchase?
    Because of this, I'm getting awarded 2 times.

    the method SetLives() does only a GET from PlayerPrefs so it's not affecting this at all...

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class BuyLife : MonoBehaviour {
    5.  
    6.     public Animation pressAnimation;
    7.     public GameObject lifeCalc;
    8.  
    9.     public void Awake()
    10.     {
    11.         Unibiller.onPurchaseCancelled += onCancelled;
    12.         Unibiller.onPurchaseFailed += onFailed;
    13.         Unibiller.onPurchaseCompleteEvent += onPurchased;
    14.     }
    15.  
    16.     void OnPress(bool isDown)
    17.     {
    18.         if (!isDown)
    19.         {
    20.             StartCoroutine("ButtonClick");
    21.         }
    22.     }
    23.  
    24.     IEnumerator ButtonClick()
    25.     {
    26.         pressAnimation.PlayQueued("Button");
    27.         yield return new WaitForSeconds(0.3f);
    28.         gameObject.transform.localScale = new Vector3(1, 1, 1);
    29.  
    30.         Unibiller.initiatePurchase("1rolife"); //initiate the purchase here
    31.     }
    32.  
    33.     private void test()
    34.     {
    35.         Debug.Log("stuff");
    36.     }
    37.  
    38.     private void onPurchased(PurchaseEvent e) //this gets run 2 times !
    39.     {
    40.         Debug.Log("Purchase OK: " + e.PurchasedItem.Id);
    41.         Debug.Log(string.Format("{0} has now been purchased {1} times.", e.PurchasedItem.name, Unibiller.GetPurchaseCount(e.PurchasedItem)));
    42.         Debug.Log("health before: " + PlayerPrefs.GetInt("playerLives"));
    43.  
    44.         int curLife = PlayerPrefs.GetInt("playerLives");
    45.         PlayerPrefs.SetInt("playerLives", curLife + 1);
    46.  
    47.         lifeCalc = GameObject.Find("PlayerInfoPanel");
    48.         if (lifeCalc != null)
    49.         {
    50.             lifeCalc.GetComponent<LifeCalculator>().SetLives();
    51.         }
    52.         Debug.Log("health after: " + PlayerPrefs.GetInt("playerLives"));
    53.     }
    54.  
    55.     private void onCancelled(PurchasableItem item)
    56.     {
    57.         Debug.Log("Purchase cancelled: " + item.Id);
    58.     }
    59.  
    60.     private void onFailed(PurchasableItem item)
    61.     {
    62.         Debug.Log("Purchase failed: " + item.Id);
    63.     }
    64.  
    65. }
    66.  

    EDIT: I managed to fix the problem in a hacky way.
    I added a bool that is set to true on clicking the button, then put to false when the onPurchased is ran so it runs only once.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class BuyLife : MonoBehaviour {
    5.  
    6.     public Animation pressAnimation;
    7.     public GameObject lifeCalc;
    8.     bool award;
    9.     public void Awake()
    10.     {
    11.         Unibiller.onPurchaseCancelled += onCancelled;
    12.         Unibiller.onPurchaseFailed += onFailed;
    13.         Unibiller.onPurchaseCompleteEvent += onPurchased;
    14.     }
    15.  
    16.     void OnPress(bool isDown)
    17.     {
    18.         if (!isDown)
    19.         {
    20.             StartCoroutine("ButtonClick");
    21.         }
    22.     }
    23.  
    24.     IEnumerator ButtonClick()
    25.     {
    26.         award = true;
    27.         pressAnimation.PlayQueued("Button");
    28.         yield return new WaitForSeconds(0.3f);
    29.         gameObject.transform.localScale = new Vector3(1, 1, 1);
    30.        
    31.         Unibiller.initiatePurchase("1rolife"); //initiate the purchase here
    32.     }
    33.  
    34.     private void test()
    35.     {
    36.         Debug.Log("stuff");
    37.     }
    38.  
    39.     private void onPurchased(PurchaseEvent e) //this gets run 2 times !
    40.     {
    41.         if (award)
    42.         {
    43.             award = false;
    44.             Debug.Log("Purchase OK: " + e.PurchasedItem.Id);
    45.             Debug.Log(string.Format("{0} has now been purchased {1} times.", e.PurchasedItem.name, Unibiller.GetPurchaseCount(e.PurchasedItem)));
    46.             Debug.Log("health before: " + PlayerPrefs.GetInt("playerLives"));
    47.  
    48.             PlayerPrefs.SetInt("playerLives", PlayerPrefs.GetInt("playerLives") + 1);
    49.  
    50.             lifeCalc = GameObject.Find("PlayerInfoPanel");
    51.             if (lifeCalc != null)
    52.             {
    53.                 lifeCalc.GetComponent<LifeCalculator>().SetLives();
    54.             }
    55.             Debug.Log("health after: " + PlayerPrefs.GetInt("playerLives"));
    56.         }
    57.     }
    58.  
    59.     private void onCancelled(PurchasableItem item)
    60.     {
    61.         Debug.Log("Purchase cancelled: " + item.Id);
    62.     }
    63.  
    64.     private void onFailed(PurchasableItem item)
    65.     {
    66.         Debug.Log("Purchase failed: " + item.Id);
    67.     }  
    68. }
    69.  
     
    Last edited: Jun 29, 2014
  8. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @johnnydj Is awake not called every time your scene changes?

    Alternatively make sure your script is not instantiated more than once.

    In any case I suggest you model your lives as a currency and let Unibill track the balance for you.
     
  9. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
  10. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
  11. WPCJack

    WPCJack

    Joined:
    Mar 15, 2013
    Posts:
    26
    Hey,

    Having a pretty good time with Unibill and most things are working fine but I am getting an odd thing where users on Android who've never made purchases are getting success messages on restore transactions?

    Code (CSharp):
    1. #if Unibill
    2.     void onTransactionsRestored(bool success)
    3.     {
    4.         Debug.Log("Transactios restored = " + success);
    5.         if (success)
    6.         {
    7. #if UNITY_IPHONE
    8.             EtceteraBinding.showAlertWithTitleMessageAndButtons("Transactions Restored", "Transactions have been restored", Strings.etceteraOkButton);
    9. #elif UNITY_ANDROID
    10.                 EtceteraAndroid.showAlert ("Transactions Restored", "Transactions have been restored", Strings.etceteraOkButton [0]);
    11. #endif
    12.  
    13.         } else
    14.         {
    15.             #if UNITY_IPHONE
    16.             EtceteraBinding.showAlertWithTitleMessageAndButtons("Unable to restore purchase", "Are you sure you've previously bought something?", Strings.etceteraOkButton);
    17.             #elif UNITY_ANDROID
    18.             EtceteraAndroid.showAlert ("Unable to restore purchase", "Are you sure you've previously bought something?", Strings.etceteraOkButton [0]);
    19.             #endif
    20.         }
    21.         Debug.Log("IAP restored " + success);
    22.     }
    Works fine on IOS but android always returns true?
     
  12. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @WPCJack as far as I know "success" for onTransactionsRestored means restore operation is completed, user may or may not have a previous purchase to restore. If there is a purchase to restore it'll also fire up a purchase event as if the user is purchased for the first time, that's where you'll need to unlock, etc.
     
  13. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @WPCJack what @PixelEnvision says is correct. That method simply indicates the restoration process has completed. If there is nothing to restore that process will still complete successfully.
     
  14. WPCJack

    WPCJack

    Joined:
    Mar 15, 2013
    Posts:
    26
    Ah, ok that's good to know. Am I correct in assuming that onTransactionsRestored will fire before the purchase events so I can start a timer to check if any transaction were there to be restored?

    I'm just concerned about having a restore purchase button that may appear faulty (inactive) or incorrectly report that purchases were restored.
     
  15. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @WPCJack the purchase events would be fired before onTransactionsRestored, which signals the end of the process.
     
  16. MindJuice

    MindJuice

    Joined:
    Jun 10, 2009
    Posts:
    18
    I purchased Unibill a few weeks ago and have finally gotten around to implementing it in my game.

    I didn't see anything like this, but does/will Unibill provide a way to test in-app purchases without actually connecting to the test servers/sandboxes?

    It would be a huge timesaver for development if Unibill could use the IAP data entered in the Unity editor to simulate purchases.

    Having to work on the device on iOS for anything needing a purchase is very tiresome.

    It would be awesome if Unibill could just pop up a dialog like "Do you want to purchase 1 Package of Fairy Dust for $0.99?" and then if I tap OK, Unibill it would complete the virtual "sale" so I can grant the purchased item. This would make it possible to develop and test all my IAP workflow in the Unity editor and then later do the on device testing.

    This could be enabled by calling something like Unibill.Initialise(Unibill.DevMode) or Unibill.InitialiseDevMode();
     
  17. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @MindJuice Unibill works fine in the editor. Purchases just succeed without any prompting.
     
  18. MindJuice

    MindJuice

    Joined:
    Jun 10, 2009
    Posts:
    18
    Well, there you go. Guess I should have tried it first. Thanks.
     
  19. ilya_ca

    ilya_ca

    Joined:
    Nov 19, 2011
    Posts:
    274
    175 bucks? WTF, you guys must be crazy. Would have purchased it for $50, but $175????
     
  20. bjornrun

    bjornrun

    Joined:
    Oct 29, 2013
    Posts:
    88
    DownloadManager.cs can't be compiled when targeting web player or WP8. Will it be fixed in next update?
     
  21. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Banderous is there a way to programatically change the Android billing platform on the fly? I know it makes modifications to some files (manfiest,etc.) when I change it in the editor, so wanted to ask as I'm planning to use this along with Advanced builder...
     
  22. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Hi,

    Is there anyway to query the number of times an item has been bought bypassing UniBill cache? The problem is that my players sometimes install my game in different devices and want to have all bought features in all of them but they only appear in the phone that has been bought (the one that have the cache built). I need to be able to query gplay service to get it from the service not the cache (that returns 0 in the phones that the game is played first time).

    Thanks in advance.
     
  23. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Hey there,

    When I use unibill on Fire TV - it shows the old school dialogues (not controller friendly). Do you guys have a date for upgrading Amazon to IAP 2.0?
     
  24. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @bjornrun that is indeed fixed.
    @PixelEnvision you can automate it in your own build process by looking at the files unibill changes. I'm not sure Unibill needs to provide anything else.
    @hexdump non consumables can be restored by calling restoreTransactions. There's no record of non consumables, so you'd need to build your own syncing system.
    @Drowning Monkeys support for Amazon's updated IAP API is coming in the next update.
     
  25. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I'd like to announce the release of Hosted Content for Unibill!

    Hosted content is a cross platform solution for serving downloadable content to paying users. Major features include:
    • Cross platform, unified API
    • Security; server side verification of purchase receipts
    • Fast downloads; edge caching across the US, Europe and Asia
    • Resumable Content downloads
    • Automatic download verification and unpacking
    • Full Editor support; test everything without leaving the Editor
    • Supports Unity Basic
    For full details see outlinegames.com/hosted-content

     
  26. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    @Banderous - sorry to bug you. are you saying it's fixed with the latest update, 56? or it will be addressed in 57?
     
  27. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Drowning Monkeys the issue you describe is with Amazon's API, not Unibill. Unibill will be updated to use Amazon's latest API in the next update or two (1.6.8/1.6.9), however.
     
  28. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    FYI - this is a warning of a problem affecting Unibill versions 1.6.0 - 1.6.7.

    This problem can lead to crashes on Google Play, and potentially other platforms.

    It's fixed in 1.6.8, pending approval.

    If you're releasing soon, please contact support@outlinegames.com with your purchase receipt for a unitypackage.
     
    Last edited: Sep 4, 2014
  29. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Last edited: Sep 4, 2014
    PixelEnvision likes this.
  30. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    160
    Hi - purchased this and started working with it. Firstly thanks for a fantastic tool.

    The problem I'm having doesn't really seem to affect things when the game is running, its just darned annoying! I'm currently building my game on my Windows machine using Unity 4.5.2p3 and quite often, my console will get filled up with the following exception:

    Code (csharp):
    1.  
    2. IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path:
    3. System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:337)
    4. InventoryPostProcessor.MoveZipLibIfNecessary ()
    5. InventoryPostProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPath)
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    7. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    8. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    9. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    10. UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssetPostprocessor.cs:26)
    11. UnityEditor.AssetDatabase:ImportAsset(String)
    12. AndroidManifestGenerator:mergeManifest()
    13. InventoryEditor:serialise()
    14. InventoryEditor:OnGUI()
    15. UnityEditor.DockArea:OnG
    16.  
    This happens as soon as I import Unibill into my game, I haven't adjusted anything as yet, so its a stock import. Has something changed in patch 3 thats causing the problem?
     
  31. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Kujo87 thanks for the report, I'll get it fixed.
     
  32. Landci

    Landci

    Joined:
    Aug 28, 2012
    Posts:
    33
    Is it possible to use float for currency? E.g. in game Currency 1,25 Coins?
    Or is the best way to use the decimal Value 125 and then devide by 100 to get the float?

    thanks Daniel.

    Oh and are you planning on integrating facebook payments?
     
  33. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Landci I'm not sure why you'd want to use float, decimal is designed for representing monetary values, but if you really want to you can just cast the decimal to a float -

    float price = (float) item.priceInLocalCurrency;

    As for facebook, there's no specific timeline for support.
     
  34. Afroman

    Afroman

    Joined:
    Aug 17, 2013
    Posts:
    43
    @Banderous Just curious, how many more platforms do you plan on supporting? I really like your product.
     
  35. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Afroman there's no set list. It depends on what becomes relevant. And thanks!
     
  36. KevinCodes4Food

    KevinCodes4Food

    Joined:
    Dec 6, 2013
    Posts:
    61
    I am encountering a fatal error when initializing Unibill on Amazon Kindle. Specifically, it appears the class "com.amazon.inapp.purchasing.ResponseReceiver" is not found. Perhaps I have left out an installation step. Any guidance would be appreciated.

    I am running the latest version of Unibill from the Asset Store, and Unity v4.5.3f3.

    Code (CSharp):
    1. D/UnibillAmazonPlugin(19784): initiateItemDataRequest
    2. D/d       (19784): In App Purchasing SDK - Sandbox Mode: PurchasingListener registered: [EMAIL]com.outlinegames.unibillAmazon.Unibill@41877560[/EMAIL]
    3. D/d       (19784): In App Purchasing SDK - Sandbox Mode: PurchasingListener Context: [EMAIL]com.unity3d.player.UnityPlayerNativeActivity@41809dd8[/EMAIL]
    4. D/c       (19784): In App Purchasing SDK - Sandbox Mode: sendGetUserDataRequest
    5. D/AndroidRuntime(19784): Shutting down VM
    6. W/dalvikvm(19784): threadid=1: thread exiting with uncaught exception (group=0x4153cac8)
    7. E/AndroidRuntime(19784): FATAL EXCEPTION: main
    8. E/AndroidRuntime(19784): java.lang.Error: FATAL EXCEPTION [main]
    9. E/AndroidRuntime(19784): Unity version     : 4.5.3f3
    10. E/AndroidRuntime(19784): Device model      : Amazon KFAPWI
    11. E/AndroidRuntime(19784): Device fingerprint: Amazon/apollo/apollo:4.2.2/JDQ39/14.3.2.5_user_325001120:user/release-keys
    12. E/AndroidRuntime(19784):
    13. E/AndroidRuntime(19784): Caused by: java.lang.RuntimeException: Unable to instantiate receiver com.amazon.inapp.purchasing.ResponseReceiver: java.lang.ClassNotFoundException: Didn't find class "com.amazon.inapp.purchasing.ResponseReceiver" on path: /data/app/com.codedvelocity.candymatchfree-2.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk
    14. E/AndroidRuntime(19784):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2422)
    15. E/AndroidRuntime(19784):     at android.app.ActivityThread.access$1500(ActivityThread.java:149)
    16. E/AndroidRuntime(19784):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
    17. E/AndroidRuntime(19784):     at android.os.Handler.dispatchMessage(Handler.java:99)
    18. E/AndroidRuntime(19784):     at android.os.Looper.loop(Looper.java:151)
    19. E/AndroidRuntime(19784):     at android.app.ActivityThread.main(ActivityThread.java:5185)
    20. E/AndroidRuntime(19784):     at java.lang.reflect.Method.invokeNative(Native Method)
    21. E/AndroidRuntime(19784):     at java.lang.reflect.Method.invoke(Method.java:511)
    22. E/AndroidRuntime(19784):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    23. E/AndroidRuntime(19784):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    24. E/AndroidRuntime(19784):     at dalvik.system.NativeStart.main(Native Method)
    25. E/AndroidRuntime(19784): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amazon.inapp.purchasing.ResponseReceiver" on path: /data/app/com.codedvelocity.candymatchfree-2.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk
    26.  
    27. E/AndroidRuntime(19784):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
    28.  
    29. E/AndroidRuntime(19784):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    30.  
    31. E/AndroidRuntime(19784):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    32.  
    33. E/AndroidRuntime(19784):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2417)
    34.  
    35. E/AndroidRuntime(19784):     ... 10 more
    36.  
    37. W/ActivityManager(  778):   Force finishing activity com.codedvelocity.candymatchfree/com.unity3d.player.UnityPlayerNativeActivity
    38.  
    39. D/UniRate (19784): 1.1
    40.  
    41. D/SoftkeyBarService(  904): ### intercept Application Error: com.codedvelocity.candymatchfree
    42.  
    43. D/Resolver(  904): icon resource drawable 2130837581
    44.  
    45. D/Resolver(  904): icon resource drawable 2130837581
    46.  
    47. W/ActivityManager(  778): Activity pause timeout for ActivityRecord{42041648 u0 com.codedvelocity.candymatchfree/com.unity3d.player.UnityPlayerNativeActivity}
    48.  
    49. D/WindowManager(  778): openingActivityName = com.amazon.kindle.otter.Launcher, animAttr = 4
    50.  
    51. V/DoNotDisturb(  778): Top component: com.codedvelocity.candymatchfree/com.unity3d.player.UnityPlayerNativeActivity
     
  37. KevinCodes4Food

    KevinCodes4Food

    Joined:
    Dec 6, 2013
    Posts:
    61
    I just figured out that our AndroidManifest in project file had an old Amazon IAP v1.0 receiver path. The path is changed for v2.0. The manifest receive must be "com.amazon.device.iap.ResponseReceiver" - not the path listed above.

    Look out for this, anyone carrying a project from Amazon IAP 1.0 to 2.0. The issue produces a fatal crash and requires console log output to diagnose.
     
  38. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    862
    Hi! I updated unbill and imported it to new project i am working on and it gives me this error
    (in short: The imported type `Newtonsoft.Json.JsonConvert' is defined multiple times)

    Code (CSharp):
    1. -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp-Editor.dll
    2. Compilation failed: 2 error(s), 0 warnings
    3. -----CompilerOutput:-stderr----------
    4. Assets/Editor/unibill/src/Extensions.cs(10,36): error CS0433: The imported type `Newtonsoft.Json.JsonConvert' is defined multiple times
    5. G:\Projects\GIT\FlipIt\Library\ScriptAssemblies\Assembly-CSharp.dll (Location of the symbol related to previous error)
    6. G:\Projects\GIT\FlipIt\Assets\Editor\unibill\Newtonsoft.Json.dll (Location of the symbol related to previous error)
    7. Assets/Editor/unibill/src/Extensions.cs(10,85): error CS0433: The imported type `Newtonsoft.Json.Formatting' is defined multiple times
    8. G:\Projects\GIT\FlipIt\Library\ScriptAssemblies\Assembly-CSharp.dll (Location of the symbol related to previous error)
    9. G:\Projects\GIT\FlipIt\Assets\Editor\unibill\Newtonsoft.Json.dll (Location of the symbol related to previous error)
    10. -----EndCompilerOutput---------------
    11. - Finished compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
    12. Assets/Editor/unibill/src/Extensions.cs(10,36): error CS0433: The imported type `Newtonsoft.Json.JsonConvert' is defined multiple times
    13. (Filename: Assets/Editor/unibill/src/Extensions.cs Line: 10)
    14. Assets/Editor/unibill/src/Extensions.cs(10,85): error CS0433: The imported type `Newtonsoft.Json.Formatting' is defined multiple times
    15. (Filename: Assets/Editor/unibill/src/Extensions.cs Line: 10)

    as much as i like unbill and as much i enjoyed using it in the past i always find it the hardest thing to import in the project. there are always something that must be fixed. what is the proper way of importing unbill to project?

    thank you!
     
  39. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    862
    ok i tracked the problem, it properly imports in empty project but conflicts with Json.NET package spilling out the already mentioned error message? How to resolve this? Thank you very much!
     
  40. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @KevinCodes4Food Unibill would remove that old response received if you changed billing platform from amazon to google play and back (though you weren't to know!)

    @pretender delete Unibill's json.net dll at Assets/Editor/Unibill
     
  41. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    862
    Hey thanks! it worked...is this the exact same file that is in the Json.NET package?
     
  42. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @pretender yes it's just json.net. It's only included in the editor dll.

    Let's all hope that Unity make a dependency manager someday and we can party like it's the 21st century.
     
  43. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hello, I have a question about restoring purchases on the Apple App Store, and am wondering if Unibill can help me.

    I want to have 5 in-app purchases: a no-ads nonconsumable purchase, and 4 "virtual cash bundle" consumable purchases that all include the no-ads feature as part of the bundle.

    Apple enforces the policy that any no-ads purchase must be restorable. That's not a problem with the simple nonconsumable no-ads purchase. But it's a problem if the no-ads was obtained as part of a consumable purchase (consumable purchases cannot be restored).

    So I was wondering if there's a way for Unibill to automatically purchase the nonconsumable no-ads purchase "behind the scenes" if the user buys a consumable virtual cash bundle, without any user intervention. In other words, automatically set the nonconsumable no-ads purchase to "purchased" on the Apple servers without the user doing anything or knowing anything.

    Or please suggest any possible better way to handle this situation. Thank you!
     
  44. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Can't you add a second non-consumable no-ads option for $0 and add that to the purchase of any first time purchase of a consumable?
     
  45. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @eridani No, there's no way to do that. Such a facility would be immediately exploited by hackers; Apple would be putting a backdoor into their own payments system.

    I believe the App receipt that unibill provides with each purchase *may* include a receipt indicating the last purchase of a given consumable. You'd need to look at Apple's documentation to figure out how to parse an app receipt.
     
  46. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Ok thanks for the input guys.

    Is it possible to do two transactions at once? Or would this require the user to purchase 2 items
     
  47. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
  48. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Hey Guys,

    @Banderous I'm having a problem w/ Amazon. The Manifest changes seem to be correct, but Unibill is not initializing. I haven't changed any code. Any thoughts as to what might be happening or how I can debug this?
     
  49. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    @Drowning Monkeys the most recent update upgraded to Amazon's V2 API.

    Have you removed the old amazon test app and installed the one now linked to in the unibill docs? It's installed via amazon marketplace.
     
  50. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    @Banderous - Does the test app need to be installed for my game to initialize? I'm not testing via the test app, i'm testing my app.