Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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

    175 vote(s)
    86.6%
  2. Voxel Busters

    10 vote(s)
    5.0%
  3. Stans Assets

    13 vote(s)
    6.4%
  4. Prime31

    4 vote(s)
    2.0%
  1. Stacksunited48

    Stacksunited48

    Joined:
    Jan 17, 2023
    Posts:
    5
    Thank you, very helpfull!
     
  2. Stacksunited48

    Stacksunited48

    Joined:
    Jan 17, 2023
    Posts:
    5
    Hi, I have a question.
    I want to link the CurrencyContainer Script to my CoinManager Script. The Currencies Metadata ID is "Coins".
    How can I save both scripts on a text?
    So that when you make a purchase, it is added to the ingame currency you have earned
    I would be very grateful for a solution to my problem. :D

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI;
    6.  
    7. public class CoinManager : MonoBehaviour
    8. {
    9.     public Text Coins;
    10.     public int coin;
    11.  
    12.     // Start is called before the first frame update
    13.  
    14.     void Start()
    15.     {
    16.         coin = PlayerPrefs.GetInt("Coins", 0);
    17.     }
    18.  
    19.     void Update()
    20.     {
    21.         Coins.text = PlayerPrefs.GetInt("Coins", 0).ToString();
    22.     }
    23.     public void addmoney()
    24.     {
    25.         coin++;
    26.         PlayerPrefs.SetInt("Coins", coin);
    27.     }
    28. }
    29.  
    30.  
     
  3. Foxxman

    Foxxman

    Joined:
    Feb 21, 2023
    Posts:
    22
    Hi, if I donate to you, will you help working on the whole integration?
    I need your help badly.
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi, first off, do not use your own PlayerPrefs entry. You are duplicating functionality which is already there - the Simple IAP System currency is stored in the DBManager. The CurrencyContainer scripts reads that currency. So it really is not a questions how to "link the CurrencyContainer to your CoinManager", it should be "link your coin system to use the DBManager" instead.

    From the code you have posted, I am not able to see anything what is missing from CurrencyContainer: it displays the amount of currency in a Text element. Also, reading from device storage (in Update) up to 40 times per frame is really bad practice. Just use the CurrencyContainer. Then in order to add coins to your game, e.g. call SIS.DBManager.AddCurrency("coins", 100) from any place the user should be awarded with coins for free.

    Adding coins on a purchase is handled automatically by defining a currency reward in the IAP Settings.

    The definition of the "Project Setup" purchase on my website is basically the integration of Simple IAP System within a reasonable time frame. The pricing is calculated to account for 2 hours of work. The purchase does not include writing the game for you, but figuring out places where code should potentially be changed and also doing that.
     
  5. jonathanurosa

    jonathanurosa

    Joined:
    Sep 24, 2018
    Posts:
    14

    I am using version 5.2.6 of Simple IAP System, and the development build mode is active. but I still get that error. I would like a closer help
     
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Thanks, it's difficult to tell without any further logs though. Could you please send me screenshots from your IAP Settings window with the PayPal setup and a link to your WebGL build in a private message?
     
  7. jonathanurosa

    jonathanurosa

    Joined:
    Sep 24, 2018
    Posts:
    14
    I have already written to you privately
     
  8. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    I really don't know which one is it. The documentation says V3.1+
     

    Attached Files:

    • SIS.png
      SIS.png
      File size:
      231.6 KB
      Views:
      80
  9. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Yeah that's roughly 7 years old.
     
  10. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845
    Hi, just wondering I own the first version and it was up there the discount had you owned the first version , but its gone. just curious was that removed?

    I still use the first version, but sooner or later I was maybe going to update so I was just curious.

    Thanks.
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @Recon03, the upgrade discount was available for one year (that was the initial plan). Today, the asset price is only half of what it was on its initial release, due to other forms of income gained. Additionally the asset is included in Asset Store sales from time to time, so there is not really an incentive to offer further discounts.
     
  12. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Hi,

    I have implemented IAP via unity and am using local receipt validation. The code works on Android, and iOS, however there seems to be an issue with local receipt validation on iOS from a lag point of view (you hit buy button and there is a 10+ second delay before you get a popup from iOS, this has caused my app review to fail). At this stage I am frustrated as I am close to launch and can not solve this issue on iOS.

    So long story short, will your asset and server side system help with this (besides the extra layer of security), or is this an issue I have to fix on my side before I migrate over to a more secure system? (specifically the delay from purchase button press to iOS response which seems to stem from local receipt validation.)

    Secondly, from a reasonably-competent coder pov, how long would the average implementation take (to setup and have working at a production level)?
     
  13. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @nobluff67, I ran a stopwatch at the moment pressing the buy button on iOS (without local validation) and it took 6 seconds for the purchase popup to show up. Adding server-side validation would add 3-4 seconds to that, so 10 in total, depending on network connectivity of course.

    Meaning, the initial purchase popup delay comes solely from using Unity IAP - I do not think that there is anything you could do to "fix" it. If your app has been declined because of this, I would suggest implementing a "purchase loading" window and listening for success/failed response to disable it afterwards.

    The integration time ranged from 1 hour for some devs up to 2 days for others. It is difficult to tell as this highly depends on your potentially already existing shop system and whether you want to use a third party cloud provider (PlayFab) or not.
     
  14. nobluff67

    nobluff67

    Joined:
    Nov 3, 2016
    Posts:
    338
    Thanks for the info.

    When you say 3rd party provider, are you talking about storing of the purchase (e.g. gold count) or are you talking about storage of the receipts (your system does that correct)?
     
  15. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    With 3rd party provider I am specifically referring to PlayFab as an optional cloud storage and inventory service. It is more complex to add which you can already see by looking over the integration guide.

    On the other hand, integrating my server side validation service (that internally stores the receipts, yes) would only take one additional hour for both Android and iOS combined since that is pretty much built in.
     
    nobluff67 likes this.
  16. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    ya I didn't ask for other discounts, but owned the last version for many yrs, so surprised to see it gone, I hate paying for software twice, update costs I have no problems with. as you should be paid for updates.. but repaying again. I will pass though. Had I known it was a yr, I may have got it sooner. I didn't notice that on the asset store?
    and hard enough to keep track of every asset, and tool, I have alot, between 3 engines... So, if you did post it, great but I never seen it... I would make it clear next time, discount for previous users only last a yr... so buy soon. So we know or something.. Most software, allows you to be discounted to buy the next version. Like you did, I never knew it expired. Again never asked for another Discount....

    Not a big deal I will just keep using the first version and update it myself like I been no biggy.

    Thanks for the info.

    PS some of us are not hobbyist and normally busy working, on our games, so I don't live on there forums or asset stores.. So, info like this would be great if posted some where to let us know that . Disappointed. You may have posted I didn't notice , but I would of added this to the asset itself, next time, so we can stay up to date....That is normally what I will check from time to time.


    By the way I used the first version for yrs, so its been great.
     
    Last edited: May 29, 2023
  17. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    I blame the Asset Store for that. The update was even free for 3 months, before transitioning to the upgrade price (again, half of current price) for additional 9-10 months. The Asset Store sends notification for updates, but does not display "important" messages, like free or paid upgrades and their durations, anywhere. With me unable to reach out to customers since the Asset Store does not provide any form of contact, it is basically impossible for me to reach everyone, besides trying with a forum post (I did that).

    Since version 1 was deprecated with releasing the upgrade, I could not mention the upgrade anywhere - again, an Asset Store flaw. I could have added an info to the new version description, but I guess I did not do that, because it would have confused non-customers.

    Thank you!
     
    Last edited: May 30, 2023
  18. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hi Baroni, did you see my message?
     
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Yes! Yesterday was a public holiday, going over all messages now :)
     
    cgutierrez71 likes this.
  20. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    845

    Ya, the asset store sucks.. its meant more for hobbyist, most of us are busy developing, and cant babysit a forum and asset store....

    They should allow for devs to notify, which is why so many asset devs have made there own stores and forums so I support those asset devs now, the asset store has been screwing me up for yrs... so I had enough. of it... and make my own tools or support old versions of tools I like... and keep my money..

    That is a laugh, I been using Unity since Unity 2, and when the store first open I still never get anything sent to me, hell I even don't get most of my receipts sent and asked support and been ignored for yrs so, that is pretty funny.. its been broke for many yrs, just like assets bought early days, we have no way to get support since we cant get invoice numbers either..So the asset store is a joke.

    Not that its your fault.... but if you guys lose customers, this is part of it, people are sick of Unity and the broken store...

    Thanks for the info. regardless... its pretty frustrating... and Unity wonders why, alot of us professionals use Unreal way more... less headaches..
     
    Last edited: Jun 2, 2023
  21. rioneye

    rioneye

    Joined:
    Aug 10, 2015
    Posts:
    12
    Hi Baroni,
    Do you have any recommendations on an approach to manage virtual currency ourselves outside of rewriting the IAPManager or DBManager? I'd like to store the users currency off the device and on a server.
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @rioneye!

    Sure, the easiest solution would be to use the PlayFab integration in the asset, since that would not require having your own server. The PlayFab integration already comes with user login and receipt validation, which ensures that not only the user gets access to its own inventory at any time or device, but also that only valid currency / purchase amounts are stored.

    If you would like to run your own server, you have to provide these two things on your own. The IAPManager offers a remote receipt validation event, where it sends purchase receipts to an endpoint you specify. So on your server, you would handle that and increase the users currency, in the best case only after validating it with the App Store. The user login system is not something related to Simple IAP System: that would be your responsibility. After logging in, the DBManager provides methods to overwrite its current database with the values you then received from your server (see Scripting Reference, e.g. Overwrite method).

    Lastly, you could have a 50-50 managed / own server combination. My Receipt Validator service can handle the purchase receipt validation part for you and then send the result to your server as a webhook, where you are free to do whatever with it. This way you would only need the user login system and allow users to request their currency inventory. Note that the receipt validation can obviously only apply to the case of buying coins for real money, not spending them in-game.

    Hope this helps to give you a rough direction!
     
  23. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Hi Baroni, I was finally able to update my game to Unity 2019.2.21f1 (64 bit) and fix all the bugs, but I can't export the apk file. I am getting a gradle build failed error. Do you think it has to do with my legacy SIS? I was able to export an apk from an empty project, which means that JDK, SDK, NDK and Gradle are correct. I would like to know how I can uninstall the entire SIS package just to find out the cause of the problem. If it's SIS, I don't have a problem updating it, but I want to make sure before that.
     

    Attached Files:

  24. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @cgutierrez71, SIS does not contain any native code (and never did), so it cannot be the cause of Gradle build errors.
     
    cgutierrez71 likes this.
  25. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69

    Hi Barony, another question. The permission: com.android.vending.BILLING permission

    Is it required in the manifest? Google told me that the requirement to update the billing library to V5 or higher is due to that permission.

    Thank you.
     
  26. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @cgutierrez71, according to Google search results, it is not necessary to have that permission in the manifest since Google injects it automatically in the merge manifest or APK. Source: here and here.

    Note: this is more of a general Unity IAP question, Simple IAP System does not modify or create an Android manifest.
     
  27. Ryoshu7

    Ryoshu7

    Joined:
    Dec 28, 2021
    Posts:
    4
    Hi Baroni, I was going through the threads and I have a similar case to: https://forum.unity.com/threads/sim...sis-shop-solution.194975/page-44#post-8998774

    I just have some questions:

    (1) I'm upgrading from the old Simple IAP System, this was an old project that I got back to. Thing is I have set up my shop UI the way I'd like it to be (similar to the horizontal scene). I'm not instantiating the UI, I'm just going to set the the product ID and metadata in the inspector. So I'm wondering since the structure somewhat changed in the new version. After backing up can I unpack the UI prefabs, delete the scripts and then save that UI as prefab and later after importing the new Simple IAP System, just attach the new scripts with the new set up as in the docs?

    (2) To confirm, since I'm also using my own system and I'm using it to add/subtract coins and save using a binary formatter. Wherever I'm adding subtracting coins, I'd have to call: DBManager.SetCurrency(ID, amount) to keep Simple IAP System in sync right?

    (3) In regards to IAP security, the latest update added support for Anti Cheat Toolkit. Setting it up according to the docs would basically encrypt all the the Simple IAP System storage. However, since in this case basically the same thing is happening in 2 different places (my currency system and Simple IAP System) I'm wondering if following the Anti cheat toolkit integration guide is enough in my case, initially I was planning to use AntiCheatToolkit in my own system. I guess in this case I'd have to encrypt both right?

    (4) When creating Game services on Google Play, you are asked whether your app uses Google API. So I'm just looking at all the plugins I'm using. Does Simple IAP System use Google API for IAP on the Play store?

    (5) I'm wondering how fetch works, does Simple IAP System check the user's location to determine what language the price and product metadata should be localized in?

    (6) This is unrelated to Simple IAP System, but I was wondering if you think IAP should be integrated before Ads or after. Reason I ask if because for Google Play you need to upload an apk to be able to create IAP products, I'm not sure if thats needed on iOS. I had some art that isn't finished yet so I didn't want to submit a build of the game just yet.

    Sorry for the long message,

    Thank you :)
     
  28. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @Ryoshu7, thanks for posting here! These are a lot of questions indeed :)

    1. I think that would work. You could also have both Simple IAP System 1 and 2 in the project, but will probably run into some script compilation errors that would only be solved by removing SIS 1. The best approach is making some notes about your products (where each product is located in your UI) and then do as you mentioned.
    2. Yes, DBManager.SetCurrency overrides the internal value with what you are passing in, which is what you want.
    3. If you are storing currency or purchases in your own format and replicate that to Simple IAP System, it is indeed not enough to use the encryption in SIS only, since attackers can hack the values prior to that, in your save file. From a security standpoint you would need to encrypt both.
    4. No, Simple IAP System does not use Google API, neither does Unity IAP. The Google API only comes into play when making use of server side receipt validation e.g. by using my website's validation service.
    5. Yes, Unity IAP does that on initialization with Google Play. By checking the "Fetch" checkbox in Simple IAP System you are just telling it to apply the metadata to the products.
    6. Either way would be ok, usually I do Ads first and then IAP (with a remove ads product). Note that the APK you upload to Google only needs the billing permission (so basically Simple IAP System included) in order to enable the IAP section. This works in either alpha or beta channels, you do not actually have to "submit" the APK or make it somehow available publicly, meaning it will not show up anywhere. This is why it does not hurt to upload an unfinished build.
     
    Ryoshu7 likes this.
  29. Ryoshu7

    Ryoshu7

    Joined:
    Dec 28, 2021
    Posts:
    4
    " No, Simple IAP System does not use Google API, neither does Unity IAP. The Google API only comes into play when making use of server side receipt validation e.g. by using my website's validation service. "

    I'm wondering is this something that is possible to switch to later in Google Play. Like if I didn't or wasn't planning to use server side receipt validation (e.g: the service you offer), but later decided to add server side receipt validation to the project. Is it possible to update that in Google Play, or you can't change it anymore?
    I'm assuming Google API is also used for cloud saving if you're using Google Play saved games.

    I also forgot to ask about the reset purchases button, currently adding it to my shop scene clutters the UI so I thought of adding it to my settings scene, if the user clicks reset purchase it loads the shop scene and enables a window where you can reset purchases. However this window isn't accessible from the shop scene (to avoid having many buttons). It's very clear how to reset purchases in our game but yeah I was wondering if you think that setup might be an issue on iOS.

    Thanks again :)
     
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Very possible! The minimum implementation (where it does not use cloud user inventory) of my Receipt Validator service only intercepts the purchasing call for validation. When it delivers the result back to the app, everything is the same. Since it is fully integrated in SIS, you only have to "toggle it" as described here. Obviously that is not something that can be enabled in the Google Play dashboard, but needs changes and a new APK from within Unity. You can then also re-verify the settings you made previously regarding the Google API.

    I would say so, yes. Basically everything you also need a Google Cloud project for in its setup.

    Ultimately it is up to the Apple reviewer to decide, but many apps offer the restore button in their settings scene, so I do not think your workflow would be an issue. In the Apple guidelines it is only specified to have a restore button, not where :)
     
  31. ishangill

    ishangill

    Joined:
    Nov 28, 2017
    Posts:
    36
    Hello i need some help from you . I am using unity 2019.4.5 version for my android game. I was start this project before 2 years ago. And at that time i am using your Asset Simple IAP . But i think that version of Simple IAP is not available on the asset store . But it works properly with my project . I already has purchased your latest asset ( Simple IAP).
    So i want to know from you , if i import this asset in my project then , is it works properly with unity 2019.4.5with out any errors .
    or i continue with old simple IAP asset. And i can not import my project to new version of unity because my project is near about 25 to 30 GB and next month i will release my game.
     
  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @ishangill, the old version of Simple IAP System (v1) only supports Unity IAP up to version 3, which is very old and you will not be able to release to Android with this. The latest version(s) of Simple IAP System supports Unity IAP 4.8.0, which incorporates Google Billing v5 that was set as mandatory for release on Google Play.

    So, this means: you have to use Unity IAP 4.8.0 or above to release on Google Play. Unity IAP 4.x is only supported for Unity 2020+ and in the latest Simple IAP System. With Unity 2019 and an old version of Unity IAP, you are out of luck.

    Additionally, you cannot just import the latest Simple IAP System into that old project, the versioning and asset upgrade (v1 and v2) was made on purpose because they contain breaking changes you have to adapt. I have an upgrade service on my website for a fixed fee if you would like to go that route.
     
  33. ishangill

    ishangill

    Joined:
    Nov 28, 2017
    Posts:
    36
    It means I will have to upgrade or import my project to unity 2020+ version. Then i will able to release the game on play store.
    One more question: is any another solution is available or not, for release my game with Simple IAP with uniy 2019.4.5 .
    Because I am very near to release the game .
    And some doubts in my mind related project upgrade to unity 2020 , because sometimes project breaks or some other problems is occurred when upgrade the project.
     
  34. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Well, you could release it without in-app purchases and completely removing Unity IAP... otherwise in the Google developer console you will see a message about using an old billing version and Google might remove your app from the store. If you continue to use Unity IAP (and Simple IAP System), you have to upgrade to Unity 2020.

    Unity 2020 was, after Unity 2019, the most stable experience for me personally. S*** goes down starting with Unity 2021 and later.
     
  35. ishangill

    ishangill

    Joined:
    Nov 28, 2017
    Posts:
    36
    Thanks for this message.
    I can not release the game with out Simple IAP .
    Now today I will download unity 2020+ version . I already have unity plus license.
    Yes you are right.
    I has seen google policies , if I release the game with older IAP , then play store might be remove my app from play store.
    Thank you so much .
     
  36. GamingTopTen

    GamingTopTen

    Joined:
    Aug 6, 2018
    Posts:
    7
    Hello, I am working on getting this to work with Steam.
    I followed your directions thus far (they were pretty good), but then I got to where it says "Open IAP Project Settings in Unity and define your IAPs there too.", and the IAP isn't there. To make matters worse, now there's a compilation error that says "IDetailedStoreListener" could not be found. IDetailedStoreListener.png
    What can I do to make the IDetailedStoreListener, listen?
    Edit: After what was about 3 hours of searching on my own, I found the solution was to upgrade the Unity IAP from 4.41 to 4.9.3. I am keeping my post here for anyone else who might wind up with the same problem I had.
     

    Attached Files:

    Last edited: Jul 1, 2023
  37. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @GamingTopTen, glad you found the solution yourself. The version distributed on the Unity Asset Store will always be compatible with the latest version of Unity IAP. The install instructions mention this:
    Please post if you experience any other issues. Thanks!
     
  38. GamingTopTen

    GamingTopTen

    Joined:
    Aug 6, 2018
    Posts:
    7
    This is probably not going to seem very smart to you, but long story short is I couldn't get my own store to work with Steam, so I tried taking your scene, 03 HorizontalScrolling and just plopped it into my game, and when I click buy from there (say, 6000 virtual coins), it just says Billing Not Available.
    BillingNot.png
    What is interesting is that the Steam Overlay works, so clearly my game and the scene you made are connected to Steam
    SteamOverlayWorks.png

    Any ideas on what it could be that is keeping it from opening the Steam checkout menu in the overlay?

    Also, to be clear, I followed all the steps of linking the IAP system to Steam.
     
    Last edited: Jul 3, 2023
  39. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    It is a bit difficult to help out remotely on this, especially if you say that you did everything in the documentation :) Meaning, the error you are seeing can have multiple causes and it is basically impossible for me to pinpoint exactly. I just assume that you are using the native Steam integration, without PlayFab?

    Please double check that:
    • changed the project's steam_appid.txt file to your app ID and restarted Unity once
    • you have copied the app build files into your local steamapps folder
    • added the SteamManager script to your first scene
    The last point came to mind first, since you said that you have simply used one of the example scenes, which do not include the SteamManager. Also, Steam initialization will fail if you cannot retrieve a single product from Steam, which will be the case when using an example scene and not adding the same (or just one) product identifier to Steam. Note that on Steam the product identifier are numbers, but this also mentioned in the documentation already.
     
  40. GamingTopTen

    GamingTopTen

    Joined:
    Aug 6, 2018
    Posts:
    7
    That is what I am doing, yes. Would you highly recommend I try going through Playfab? Is the juice worth the squeeze?
    Edit: I got it to work. Had to disable some Paypal billing provider override stuff (can't remember if that is on by default or if I did it by accident):
    SteamStoreWorks.png
     
    Last edited: Jul 3, 2023
    Baroni likes this.
  41. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    It depends on your game requirements. For example if you offer a few non-consumable products, then you don't need advanced user inventory mechanics, since Steam Inventory can handle that too. PlayFab adds a lot more complexity so if you are having issues with the native Steam integration, adding PlayFab on top will not help.
     
  42. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I have SIAP version 1. I am thinking up upgrading.
    1) How to upgrade? Is it as simple as deleting old folder and importing new one? Will the scripts accept that and work? I have modified the IAP listener obviously.
    2) in SIAP 1, there is an error that makes the projects unusable. Can you tell me the fix so at least I can get a project working again.

    Assets\SimpleIAPSystem\Scripts\IAPManager.cs(26,43): error CS0535: 'IAPManager' does not implement interface member 'IStoreListener.OnInitializeFailed(InitializationFailureReason, string)'


    3) Is there a discount for the upgrade?
    4) what does v2 do that v1 does not?
     
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Please see the post above for some details and differences between SIS 1 and 2. Fundamentally, SIS 2 should be treated as a completely new version, which took more than 4 months of dedicated development time. Upgrading is not as simple as replacing the folder since it contains breaking changes - on purpose, since that was a good chance to do it - therefore the upgrade and package change. For upgrading, please see the initial 5.0 changelog entry for upgrade notes and more information.

    Optionally, I also offer a paid upgrade service on my website which includes making necessary code changes in existing code.

    Implement (add) the method OnInitializeFailed(InitializationFailureReason, string) to the IAPListener. This change was introduced in a later Unity IAP version.

    The upgrade was free for 3 months, then 50% off for additional 9 months, and now purchasable at its full price, which was lowered by 50% due to other sources of income. So basically, the current price is the upgrade price.

    SIS1 used an old Unity IAP version and does not receive further updates or support from me. To be able to release on current platforms, newer Unity IAP versions need to be used, which at some point, require code changes. SIS2 has a new underlying billing system, supporting PayPal and more fixes to Steam, but also better support for adding own billing systems, billing events and server side receipt validation.
     
  44. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Last edited: Jul 5, 2023
  45. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    @RandomCharacters Yes, still me, different company name (see first post in this thread).

    Regarding the error, since this is coming from Unity IAP you want to check this post for the cause and the one after that for the solution with sample code.
     
  46. GamingTopTen

    GamingTopTen

    Joined:
    Aug 6, 2018
    Posts:
    7
    Working on this project is slowly driving me insane. Here is my normal store for now:
    NormalStore.png

    If I hit the main menu and then go back to the store, it looks like this:
    Problem1.png
    Additionally, there are now two errors that show up on the debugging menu. Problem2.png
    Problem3.png

    I do not know what all these things in the debugger mean, nor do I understand why they would show up in the first place. One day the payment system worked and now it's got two new bugs just because...?

    I tried updating to see if there was a new version as that solved a previous issue, but there was not one so it did not solve here. I guess I'm just going to work on other aspects of my game for now...
     
  47. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,278
    Hi @GamingTopTen, thanks for the screenshots. You will want to check if you have multiple IAPManager prefabs in different scenes (there should only be one in the first scene of your app) or multiple IAPContainer scripts in your shop scene. The first error screenshot says it is trying to instantiate a product multiple times.

    The second error says that you have probably enabled or disabled encryption on the DBManager component without clearing local save data first. Therefore, it cannot read it anymore and throws that exception. The solution to this is to start the game in the editor, open the Simple IAP System project settings > tools and press the "Local Storage - Clear" button.
     
  48. GamingTopTen

    GamingTopTen

    Joined:
    Aug 6, 2018
    Posts:
    7
    This fixed both problems, as there wasn't a local storage to clear.

    In any case, now I get to the final and biggest step in getting my store to work.

    I have a variable that is a stored float called "PurchasedLives", that, as you can guess, how many starting lives the player used United States Dollars to purchase. It looks something like this in a prototype button I made:
    ProblemA.png
    I have named the currency the player will be buying "Lives" which converts into "PurchasedLives" at 1:1
    ProblemB.png

    ProblemC.png
    The thing is, when I go through a transaction, the currency has one added to it. How do I make it so that when the purchase goes through and is complete, the "ES3.Save<float>("PurchasedLives", (ES3.Load<float>("PurchasedLives", 0)) + 1);" code also goes through.

    In layman's terms, do you have an idea on how I can connect the IAP Currency bone to the Game Life Counter bone?
     
  49. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I bought the new version and am ready to upgrade.
    in the scenes, do i delete the ShopManager assets?

    Thanks.
     
    Last edited: Jul 16, 2023
  50. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Another question. Am I to understand that restore is no longer used? So I would just delete it then?




    public void HandleSuccessfulPurchase(string productID)
    {
    if (IAPManager.isDebug) Debug.Log("IAPListener reports: HandleSuccessfulPurchase: " + productID);
    //differ between ids set in the IAP Settings editor
    switch (productID)
    {
    //section for in app purchases
    case "proversion":
    //the user bought the item "proversion", show appropriate feedback
    ShowMessage("The game is now unlocked. You can now have unlimited play with no timers.");
    break;
    case "restore":
    //nothing else to call here,
    //the actual restore is handled by IAPManager
    ShowMessage("Restored transactions!");
    break;
    default:
    ShowMessage("Product (" + productID + ") bought!");
    break;
    }
    }
     

    Attached Files: