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. Ziad

    Ziad

    Joined:
    Aug 5, 2012
    Posts:
    12
    W
    WOW!
    It works!
    I don't know how to thank you @Baroni thanks a lot !
     
    Baroni likes this.
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Write a nice review :D
     
  3. Slev

    Slev

    Joined:
    Sep 8, 2012
    Posts:
    148
    I've been getting the infamous

    Code (csharp):
    1. Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)
    I have the app key set properly, is this an issue with OpenIAB and not with SIS? Do you know what I can do to fix it, I checked the manifest and billing is allowed. I'm only trying to access the regular Google Play store.
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    This is a known issue with one of the latest OpenIAB versions, please refer to this post for a possible solution.
     
  5. Slev

    Slev

    Joined:
    Sep 8, 2012
    Posts:
    148
    Yup I took a look, going to try installing it as an alpha build through google play... since it seems if you install it with unity it doesn't know which shop to try and use.
     
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @Slev that's weird, I don't get these issues when using OpenIAB 0.9.7.2 and deploying directly to the device from within Unity. If you have a test project ready, you could send it to me via email and I'll try to find the cause of this.
     
  7. Slev

    Slev

    Joined:
    Sep 8, 2012
    Posts:
    148
    I was able to confirm it is an issue with OpenIAB. I installed it from the appstore alpha page and purchases worked right away.
     
  8. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Hello Baroni,
    I am having some UI issues with the SIS example scenes even in a new project in version 4.6.2p2 where only the Title element displays in the Horizontal layouts. It was working fine before I updated (which I did to get around rect.transform errors in another plugin in my previous version of 4.6) and then after the update my previously fully functional store stopped showing on my device. It all displays fine in the editor even in Play mode, this issue doesn't show itself until I test on a device. I'm using Android 4.4 on my phone. I did a lot of testing, but no matter what even a brand new project with only the SIS examples and OpenIAP in it behaves the same way - Vertical mode isn't showing descriptions but at least shows sprites and prices., Horizontal only shows titles.
     

    Attached Files:

  9. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Hi @mechangel,
    are there any errors showing up in the device log? Did you test on another device (to verify it isn't related to the model/Android version) or could you send me the project via email for investigation?
     
  10. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Hi, I tried 3 different devices so far, but I felt that wasn't the issue anyway because it worked on my phone ever since I purchased SIS right up until when I updated my Unity yesterday. Old builds still work and make purchses on my phone, but I made those before updating Unity. I gathered the other devices, another phone and a tablet, for testing before posting to make sure I wasn't wasting you time. I wish I knew how to set up a device log, I run my apks by transferring them via a multi-ended USB/mini-USB thumb drive since I always have issues setting up logcat with Eclipse. I would send you the project, but all I did was make a new project and followed setup as usual- (import SIS - import Open IAB and the latest Open IAB package - Added all the test scenes to my build settings - opened the SIS window - saved - closed SIS window - Build)
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @mechangel
    Thanks for testing this on different devices. I've downloaded Unity 4.6.3 and experienced the same result, although loading the shop scene directly worked fine. So I guess this is some weird UI ordering issue Unity introduced in the latest version, where UI elements take an additional frame to get loaded. That's why the UIPanelStretch script in SIS has incorrect values and aligns product prefabs wrong. To work around it, open UIPanelStretch.cs and insert this:

    Code (csharp):
    1.     void Start()
    2.     {
    3.         Reposition();
    4.     }
    Thanks for bringing it up, I'll update the official package soon. There is another issue when using the latest OpenIAB package (billing unavailable) which will be fixed too.

    Edit: The above "fix" is not really a fix, because the UI in 4.6.2p2+ breaks a lot more things and is not usable in my opinion (see below). I've reverted the official version of Simple IAP System from 2.5.1 back to 2.5.
     
    Last edited: Feb 22, 2015
  12. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    A note to all Unity 4.6.2p2 or 4.6.3 users: I do not recommend upgrading to these versions.

    RectTransform: initialization has changed, breaking everything that accesses RectTransforms in Awake
    Masking: doesn't work at all, your UI elements will not stay within the defined bounds
    GridLayoutGroup: ignores vertical layouts completely and aligns them horizontally instead

    Try using 4.6.0 - 4.6.2 for a much better experience.
     
  13. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    100
    Hi,
    I just installed your latest version using Unity 4.6.1, also installed OpenIAB 9.7.1

    And get these errors in the console:

    Code (CSharp):
    1.  
    2.  
    3. Assets/SIS/Scripts/IAPManager.cs(168,51): error CS0103: The name `SearchStrategy' does not exist in the current context
    Code (CSharp):
    1. Assets/SIS/Scripts/IAPManager.cs(168,29): error CS1061: Type `OnePF.Options' does not contain a definition for `storeSearchStrategy' and no extension method `storeSearchStrategy' of type `OnePF.Options' could be found (are you missing a using directive or an assembly reference?)
    2.  
    John
     
  14. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
  15. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    39
    Hi Baroni, how do I check if a non-consumable purchase it was made in a new installation of the app (Android),
    I mean, I kwon that DBManager identifies the purchase, where I can fire the events after that? On IAPListener?
     
  16. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @TBrayner Hey, IAPListener's HandleSuccessfulPurchase method should be used to unlock game content after it has been purchased, correct. It gets fired automatically and also (again) after the user presses the restore transactions button.
     
    Xomanowar likes this.
  17. Xomanowar

    Xomanowar

    Joined:
    Apr 2, 2014
    Posts:
    39
    I understood, thks!
     
  18. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Free asset giveaway!

    Starting next month, we will be giving away this or one of our other assets (http://u3d.as/2uX) to one lucky follower every month. Follow us on Twitter @Rebound_G to stay updated and don't miss the chance to win!
     
  19. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    100
  20. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
  21. PlayKiseki

    PlayKiseki

    Joined:
    Oct 4, 2014
    Posts:
    14
    Hi Baroni,

    Thanks for your help before! I'm currently experiencing another problem with my in-app products. When tapping on the purchase button, nothing is happening when tested on-device.

    When testing on Unity, the usual window saying "Calling purchase ID..." etc. appears and all seems well. On the device the IAP information is fetched successfully however nothing at all happens when tapping the purchase buttons. No error, no purchase flow or anything. Do you have any idea what might cause this? It started happening randomly from one build to the next. Do you have any idea how to fix it?

    Thanks!
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Hey, that's nearly impossible for me to figure out. You can always send me a project that reproduces this to my mail, so I can take a deeper look at it.
     
  23. PlayKiseki

    PlayKiseki

    Joined:
    Oct 4, 2014
    Posts:
    14
    Hi! Sorry, derp derp on my part. I fixed the issue- it was a missing manifest activity!
     
    Baroni likes this.
  24. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    How do I not have that little green arrow slide out when the Buy button is pressed? I don't want the use to click twice to buy something, just click once (with no green arrow ever showing).

    I tried setting the "Buy Button" to "buyTrigger" and "Buy Trigger" to "none" in the IGC prefab but it didn't work.

    Thanks!
     
  25. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    On the IGCItem prefab, you can just delete the buyTrigger gameobject and set the buyButton to active. Make your changes in the scene and apply them back to your prefab afterwards.
     
  26. nonaxanon

    nonaxanon

    Joined:
    Jan 20, 2012
    Posts:
    43
    would like to know an aproximate date on update to unity 5, since after 4.6.1 or so, every Canvas broke, also with unity5 , theres a dll error thrown, fixed by deleting library from the game project, but still the canvases are all broken, red X on the images, reversed, i think its called
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @nonaxanon Simple IAP System does not come with dlls, which one do you mean? I'll have a look at the workarounds available this week. The canvas issue starts with version 4.6.2p2.
     
  28. ptcki

    ptcki

    Joined:
    Feb 3, 2015
    Posts:
    4
    Hey RG! I am experiencing the same issue with Canvas - any news when you will be fixing this or some info how could I fix this myself would be extremely helpful. Thanks
     
  29. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Hi ptcki, a quick fix is to rename "public void Reposition()" in UIPanelStretch.cs to "void Start()" and remove the call in ShopManager.cs. This fix only works if you are starting the game from a different scene, not from the shop scene directly. I am investigating how to solve that too.

    Clarification: by "different scene" I actually meant the first scene with your IAPManager prefab
     
    Last edited: Mar 7, 2015
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @ptcki @nonaxanon I need to upload a new version for Unity 5 and all the billing packages / scenes early next week, but the "Canvas reversed issue thing" is fixed now.
     
  31. ptcki

    ptcki

    Joined:
    Feb 3, 2015
    Posts:
    4
    Good news, can't wait! Unfortunately - The quick fix doesn't work on my android device.
     
  32. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Is SIS working now for 4.6.3? Or should we stick with 4.6.2 if we are planning a release? Thanks Baroni

    P.S. Is it ok to use OpenIAB 0.9.8.6 now or should we stick to an earlier version
     
  33. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @eridani
    The current version of SIS is compatible with Unity 4.6.2 (until but excluding p2) and OpenIAB 0.9.8.4 or above.

    For Unity 4.6.3 and 5.0, a new version will be released in the coming days.
     
  34. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Ok thanks, will wait for that. The new version works with OpenIAB 0.9.8.6?
     
  35. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @eridani The current version does too:
     
  36. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hmm OpenIAB 0.9.8.6 wasn't working for me with Unity 4.6.2 but I'll try it again with 4.6.3 when your new version comes out
     
  37. ptcki

    ptcki

    Joined:
    Feb 3, 2015
    Posts:
    4
    Update: The quick fix with renaming to Start works with 4.6.3, but it doesn't work with 5.0.
     
  38. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Could you send me a private message with your invoice no.? I would like to send you my modifications before updating the official package, because that's a huge undertaking every time I do it...
     
  39. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Hey there, I know there's lots of changes flying around in the air but I figured I'd put my current status in in case it helps in some way. For 4.6.2p2 I changed the "awake" to "start" in IAPManager.cs and add the IAPManager prefab when I load my store scene. For some reason the store items only display properly if I load the prefab in that scene. That trick stopped working in Unity 5 though, it still shows up in Editor but not on the device.
     
  40. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Hi Baroni,

    Is there an issue with Unity 5 (uGUI) and locked items? Please see the following image:
    The 'BuyTrigger' game object (with price) should overlay the standard locked button when unlocked, but it doesn't show up. Any thoughts what could be causing this? Am I missing something? It seems like some sort of clipping/overlay bug.

    Cheers!
     
  41. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    @mechangel
    Hey, is your problem related to this post we talked about ealier? If so, please update to version 2.5.1 which fixes prefab UI issues in newer Unity versions. Don't change the initialization order of IAPManager though, it has to be in the first scene and loaded first.

    @TWaanders
    Hi T, all locked UI elements that should disappear after the product has been unlocked should be added to the "Hide On Unlock" array. I wouldn't use shared elements for locked/unlocked states and rely on Unity to sort them correctly...
     
  42. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Hi @Baroni , The asset store isn't telling me to update, does that mean I have 2.5.1? I'm not sure how to check which version I'm running. I reimported SIS and made sure there is only an IAPManager prefab in the first scene, but I'm still not getting items to load at all now in the shop canvas, and this error started popping up "
    UnityException: Transform child out of bounds
    UIPanelStretch+<Start>c__Iterator6.MoveNext () (at Assets/SIS/Scripts/UIPanelStretch.cs:30)"

    Edit: It seems to be that my IAPManager prefab isn't following me from scene to scene anymore for some reason after I reimported. My calls to update currency are failing even when there is an IAPManager prefab present as well.
     
    Last edited: Mar 17, 2015
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Hi, you can check the version number you are running by looking at the changelog txt file included in SIS. Did you assign the prefab + parent container in the IAP Settings editor in your shop scene - meaning does it actually instantiate your products?
     
  44. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    I made a new test project and imported SIS 2.5.1 in Unity 5, it runs fine in the editor and displays the sample products. Using OpenIAB 0.9.8, I'm able to build an apk but no items display in the shop on the device. Using OpenIAB 0.9.8.6 still works in editor but throws build errors when I try to make an apk, "Unable to convert classes into dex format. " Am I using the wrong version of one of these packages?
     
  45. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Sorry I didn't actually reply to what you asked, it was all working in editor. I should have specified my issues were with running on device.
     
  46. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    I've tried both Unity 4.6 and 5.0 with my Google Play dev key and bundle identifier, using OpenIAB 0.9.8.6 and building for Android ARMv7. Products and localized prices show up as usual and there aren't any building errors. Have you had a look at the device log for suspicious errors?
     
  47. mechangel

    mechangel

    Joined:
    Nov 6, 2012
    Posts:
    73
    Thanks for confirming the versions! I was able to get Unity 5.0 to build OpenIAB 0.9.8.6 with a clean test project and starting with those versions (rather than trying to upgrade OpenIAB in an existing project) and was able to make a clean build of an APK no problem. I'm only seeing the items display through a tiny scrollrect view. thank you again for helping me troubleshoot!

    Edit: attached log file, I don't see anything that looks suspicious, but it's a little hard for me to tell what is normal.
     

    Attached Files:

    Last edited: Mar 17, 2015
  48. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Thanks for your reply Baroni!
    I ran into another (simple) issue, this time with selected items. They work fine, except for the following:

    I set up the IAitems to be single selection, and it works, whenever I 'purchase' and then select an item, its status changes to 'Selected'. However I can select multiple items without the other items changing back to Select. This means I can have multiple Selected items at the same time.

    If I stop the game and run it again, however, it does work and only the actual selected item is Selected. :S. What am I missing? The IAitems are set up correctly, (same problem with standard IAitem prefabs). Also, the sample scene works fine so it must have something to do with the Shopmanager I guess?
     
  49. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,265
    Does your group container in the scene have a ToggleGroup component attached to it, just like the ones in the example scenes (the Armory container transform for example)?

    @mechangel
    Sorry for the late reply, didn't see you've edited your post because I don't get email notifications for that. In your log there is
    Code (csharp):
    1. IAPManager: Google Store Key missing on IAP Manager prefab. Purchases for real money won't be supported on the device.
    I'm not sure if that causes the smaller view though. If this is happening in the editor too, maybe you could check the scroll view area? Only on device is a bit difficult to debug...
     
    Last edited: Mar 19, 2015
  50. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Excellent, that did the trick! Thanks a lot!
     
    Baroni likes this.