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

    173 vote(s)
    86.5%
  2. Voxel Busters

    10 vote(s)
    5.0%
  3. Stans Assets

    13 vote(s)
    6.5%
  4. Prime31

    4 vote(s)
    2.0%
  1. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @michealcaj, currently PayPal is supported on WebGL. You could either use PayPal native (without player login and inventory) but then you have to think about how you would like to store the purchases yourself, or PayPal with PlayFab which does that for you.
     
  2. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    191
    Thanks brother
     
  3. GlennVerheij

    GlennVerheij

    Joined:
    Apr 21, 2018
    Posts:
    7
    Thanks Baroni, I got the JSON files uploaded. Only problem now is I got the following error:

    // Developer configuration error; check product metadata.
    Debug.LogWarning("No products available for purchase!");

    the error I get after that:
    Unity IAP is not initialized correctly! Please check your billing settings.

    What product metadata should I check? I assume there is still a problem with the JSON file? Weird thing is when I test a build that is linked to the test steam game "SpaceWar", I do get a steam iap popup (when the product ID is "100"). So in Unity I think everything works correctly.
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Difficult to tell, there are actually lots of different things coming into play regarding Steam IAPs. It could be that
    1. Your product identifier you have uploaded and entered in Simple IAP System could not be found
    2. It could be an issue with the Unity game not connecting to the correct Steam game backend (i.e. wrong application ID)
    3. Missing package in Steamworks (that seems unlikely since you were able to upload the JSON already)
    4. Not logged in with developer account
    5. Not starting game from Steam but files are located in steamapps folder
    6. (or probably something else I forgot to mention)

    If the Steam IAP popup does not open for your game, first check if you are able to open the Steam in-game menu at all. If that's the case, you would indeed need to check the product metadata, meaning the product definitions in Steam and Simple IAP System. Note that a product ID "000" is not allowed, and "100" could be reserved by Steam too, so e.g. check with "200" or some other number for testing too. If Unity IAP still cannot initialize correctly even if all product data seems to be correct, it is likely that the connection to the Steam backend is at fault.
     
  5. GlennVerheij

    GlennVerheij

    Joined:
    Apr 21, 2018
    Posts:
    7
    Hey Baroni, I just got it working. For testing I had builds in several locations on my pc. After deleting all those builds the steam iap popup appeared. Thanks for all the help. :)
     
    Baroni likes this.
  6. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    208
    I'm upgrading an older project due to Google's sunsetting of their Billing Library version 3

    The project was using:
    Unity 2019.4
    IAP 3.2.3
    SIS 4.3.7

    I have upgraded and now have this.
    Unity 2021.3.x
    IAP 4.4.1
    SIS 4.3.7 *

    I have a couple of errors referencing Samsung store that I can comment out which is not a big deal.

    My question is will SIS 4.3.7 still work in this configuration?

    I'm don't mind purchasing the new SIS (And will anyways), I just don't want to try and dig back into the old project and implement the new package throughout the UI if I don't have to.

    Thanks in advance!
     
  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @BigToe, thanks for posting!

    SIS 4.3.7 was made compatible with Unity IAP 3.x. If you delete the Samsung specific parts (which were deprecated by Unity) and do not receive further errors, it is likely that it should work. I can't be 100% sure though, so I would recommend deploying a build to your device and doing a purchase using a test user. If that works, you're set.
     
  8. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    Hello,

    I've almost got my steam implementation figured out, but I'm having an issue where the Steam Overlay doesn't appear when I call IAPManager.Purchase(itemId).

    In the logs it looks like I'm reaching SteamStore line 196 `SteamInventory.StartPurchase`

    I've verified that my item ids are all up on steam via the json document. I'm using steam to install & test the build. I'm using the directive `STEAM_IAP` but I do have PlayFab in my project.

    I wasn't able to get the IAP initialization to work when I used the `PLAYFAB_STEAM` directive. For some reason it was immediately trying to grab the catalog data so I disabled AutoInitialize, but the OnInitialized callback wasn't triggering. So it seems like there must be something else that needs to happen, but I didn't see anything in the docs.
     
  9. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hello @Benjaben22,

    answering your private message, the Steam Inventory service and PlayFab Steam option are exclusive. Steam Inventory lets Steam save user purchases on their Steam account automatically. So if you would like to have them in PlayFab, you should go with PlayFab Steam instead.

    Please double check the points above in this post regarding Steam overlay not showing up:
    https://forum.unity.com/threads/sim...sis-shop-solution.194975/page-37#post-8503445

    You should first get the connection to Steam working before trying to purchase any products. Initialization will obviously always fail if the app does not receive any Steam backend data. Did you put the SteamManager component from Steamworks in the first scene of your app too? Sorry to not be more helpful here, as there are a lot of settings with Steam involved and it is impossible for me to provide the exact cause remotely.
     
  10. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    Hello,

    Yeah I did a bit more reading into the systems last night. Steam Inventory is a little more than what I thought it was.

    I do have Steam working with PlayFab already using the Steam Manager. The user is able to login and everything. I also read up on the PlayFabClientAPI.PayForPurchase() API that is supposed to trigger the steam overlay.

    In regards to the `PLAYFAB_STEAM` directive not working. I realized that doesn't work in the Unity Editor and the Unity IAP system only works if you launch via Steam.

    What I'm trying to solve now is why the PlayFabSteamStore doesn't trigger Initiate Purchase. There are a ton of things to figure out haha
     
  11. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    Alrighty so I figured out the issue, but I'm not certain how to solve it.

    In IAPManager at line 382 where it checks for controller == null. Controller is always null. So it seems like my initialization of the IAPManager isn't working.

    I'm calling
    IAPManager.GetInstance().Initialize();
    PlayFabStore.instance.Initialize(_callbacks);

    After the user logs into PlayFab. I had my own login flow so I had to alter how PlayFabManager was trying to login the user immediately.

    Is there any reason this wouldn't work?
     
  12. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    Alrighty so I realized my project is a bit behind your current version of Simple IAP. I'm going to try to updating to a new version of Unity and re-installing Simple IAP
     
  13. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Two points on this workflow:
    1. You should definitely not call any internal PlayFabStore methods for initialization. This is not supported, the IAPManager does all of this for you if set up correctly.
    2. Are you using a custom login form i.e. with email? On Steam, the PlayFabManager tries to automatically log the user in using the Steam credentials, so no manual interaction is required. After authentication the IAPManager initialization is then processed as a next step, automatically too.

    You can let the PlayFabManager receive and process the product catalog manually (and later initialize the IAPManager) if you are done with your custom login - in this case you only have to call the PlayFabManager.OnLoggedIn method with your login result. The "auto initialize" checkbox on the IAPManager should be disabled if you are using PlayFab, as mentioned in the integration guide.
     
  14. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    Yeah I just ended up pulling the whole thing since how I had it setup for mobile doesn't seem like it's going to work for Steam at all. My plugins were all massively out of date too.
     
  15. Benjaben22

    Benjaben22

    Joined:
    Oct 26, 2012
    Posts:
    75
    But I will try to update it all and see what happens.
     
  16. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there @Baroni ! I'm upgrading Unity IAP 4.1.2 -> 4.5.1 and SIS 2 5.0.6 -> 5.2.1
    Just read upgrade guide...
    Can i use IAP and SIS 2 without UGS subscription?
     
    Last edited: Oct 28, 2022
  17. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @justtime!
    Yes - in the IAPManager at line 193, you can comment out its initialization and remove the "async" keyword from the method. Unity IAP will throw a warning about UGS not being used then, but as confirmed by Unity this can be ignored (at this point).
     
    justtime likes this.
  18. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    As i understand from your link, i can leave UGS initialization method() without entering payment info and it should work. For me in my test build it works fine.
     
  19. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Hi,

    I have to still use Simple IAP 2 (5.0.0) since I don't want to update it to the newest version. In my Project I want to have access to the normal Scenes, that have been made to see how things were made there, but I can't open the shop, because it has already been customized.

    Is there a way that you upload 5.0.0 somewhere as a package and that I open it?

    Greetings
     
  20. dave_oak

    dave_oak

    Joined:
    Oct 7, 2015
    Posts:
    26
    Hi, I'm just integrating SIS into my game to allow Paypal IAP for WebGL builds that are independent of Facebook. I'm not using any of the SIS UI, as I have an existing UI for IAP. The flow is working great, except that I can't see a feature to restore purchases. Does this exist for PayPal? I'm not using PlayFab.
    Thanks!
     
  21. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Is the newest IAP System working with Unity 2019, too? I'm getting many errors when activating Playfab Full Stack, my whole project crashes. Will the newest Version work with unity 2019, too??? In the package manager I can select to download it. Maybe then playfab integration will work as well...

    This Errormessage comes up in my Simple IAP 5.0.0 version:
    PlayerSettings Validation: Requested build target group (26) doesn't exist; #define symbols for scripting won't be added.
    #0 GetStacktrace(int)
    #1 DebugStringToFile(DebugStringToFileData const&)
    #2 EditorOnlyPlayerSettings::SetUserScriptingDefineSymbolsForGroup(int, core::basic_string<char, core::StringStorageDefault<char> > const&)
    #3 PlayerSettings_CUSTOM_SetScriptingDefineSymbolsForGroupInternal(BuildTargetPlatformGroup, ScriptingBackendNativeStringPtrOpaque*)
    #4 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroupInternal (UnityEditor.BuildTargetGroup,string)

    And after, I get these messages (see Imgur-link), what am I doing wrong? I even updated to the newest Playfab SDK. Using Unity 2019.4.3, these are the other Errormessages that occur:

    https://imgur.com/a/bjcvuGL
     
    Last edited: Nov 5, 2022
  22. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    @Baroni I'm not sure if I should have mentioned you with "@", wasn't sure if you saw my Request.
     
  23. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    @Gushmeister Very sorry for the delayed response! I did indeed miss your (and other) posts since the forum did not send me a mail notification for whatever reason.

    Unfortunately I have to say that while Simple IAP System should work with Unity 2019, Unity IAP is definitely not supported anymore. Additionally, SIS 5.0.0 received several improvements and bug fixes in subsequent versions - most of the scripts in your screenshot do not exist anymore as they have been simplified or renamed. I am unable to support Unity 2019 either, as it ran out of official LTS state a while ago.

    Regarding "Requested build target group (26) doesn't exist", that might relate to the Facebook build platform which was removed by Unity. You could delete the script lines mentioning this. When it comes to the errors in your screenshot, if you just upgraded SIS on top of the old version, try the removing the folder and doing a fresh import instead. Again, note that I do not advise using old (Unity IAP + SIS) versions in production.

    Hi dave, thanks for your question. Since PayPal only acts as a billing processor, it does not offer any authentication and player inventory features like a regular cloud service would. Because of this, there is no restore functionality on PayPal as this would require both features mentioned. There is also a note about this on the PayPal guide, in the Prerequisites section, starting with "PayPal does not offer its own user login and inventory service [...]".
     
  24. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Hi Baroni! Happily I updated to unity 2021 and my Animations (Anima2D) still work xD So now I've got full M1 support, everything is faster, just perfect!

    In my old Simple IAP System I had your App listed under "Window -> Simple IAP System", there I could start the Plugin where I could choose if I want Playfab "Validation only" or "Full Suite". Simple IAP System now isn't listed there anymore, only way to access things is by edit -> Project Settings. But I can't find where to choose "Validaton only" or "Full Suite" there? I downloaded the Playfab SDK Extension, and it imported a new folder with scripts and stuff, but I still can't find where to choose those mentioned playful options.

    Where can I find "Full Suite" now?

    Greetings and thanks for your support!
     
  25. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @Gushmeister, great to hear that your migration was easier than expected ;)

    The current PlayFab guide is what you want to look at - the linked section specifically mentions this. The checkbox is on the PlayFabManager script now (which you do not want to enable) :)
     
  26. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Ah cool, ya I was already thinking that, but I thought maybe you forgot to put this in, cuz in your "normal" unity doc (pdf) you write:
    1. Make sure PlayFab “Full Suite” or “Validation Only” is set in our Plugin Setup window

    2. Add the ReceiptValidatorService component to the IAPManager prefab
    Which was 1:1 the same like in early versions - you should take this out, cuz in the Plugin Window it's not available anymore :).

    Another question: Do subscriptions work till the day? I want to integrate a Season-Pass. If I can't do this via PlayFab, could I do it different?

    Greetings and thanks again!
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Oh, sorry. Yeah I'm going to remove that part, thanks!
    Unfortunately subscriptions are still not supported on PlayFab. However, as an alternative you could offer a time based product. This product could be exchanged for a premium virtual currency instead. The downside to this is that users would need to "buy" it again each season.
     
  28. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Ya sure, that's totally okay, and I think customers will also be happy, that the subscription is not automatically continued each month. If time's over, I could ask the user, if he wants to continue? And then he would buy it again.
     
  29. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Okay, so one more question :) How are currencies handled now? Do I have to take care of something like "Dollar" or "Euro" or will this automatically switch and recalculate prices in different stores? Can I set prices, dependent of currency, independently?
     
  30. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Currency conversion did not change - the App Stores are responsible for this, not Simple IAP System or PlayFab. You would enter the desired prices e.g. in Google Play / Apple App Store for your product. There is no selection based on currency, but the App Stores allow setting different prices per country. When users try to purchase a product, the native dialog displays the user's local currency.
     
  31. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Hi @Baroni, it's me again :) I'm totally stuck with the Playfab integration. I managed to make Apple and Google-Addons work, and so far I understood, what Receipt Validation does. My Database was exported and imported via JSON into Playfab, this works also (I want to use the Full-Suite). But where I get stuck, is at the point, where I have to login into Azure. I just thought I'll be able to use normal Cloud-Scripts, but this Azure-Thing is where I get stuck. I don't see the menu, that you have uploaded in your Playfab-Guide. I even don't know, if I'm really logged in with my right credentials there and if my Playfab is really connected. I've put in my E-Mail (which I use on Playfab-Login), and had to send a verification-code to my real E-Mail to log-in there. Once being in, I press the "Functions-App" (or Funktions-App) - Symbol, and it opens a menu where I have to make a subscription for real money? I've linked the screenshot in the Imgur-Link. What do I have to do? Am I not able to use this for free??? Do I have to pay for this now?

    https://imgur.com/FpO4kAM

    Or did I do something completely wrong? xD
     
  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hey @Gushmeister, with the aquisition of PlayFab by Microsoft in 2018 they also shut down PlayFab's own servers executing Cloud Script. It was possible to run the old Cloud Scripts until somewhen in 2020, but not anymore - this requires Azure functions now.

    The two methods Simple IAP System uses for synchronisation to PlayFab (running on Azure) are the methods listed in the guide: grantItems and addCurrency. These methods are for use cases where you want to "gift" items or currency to the user, such as giving out products for free, or adding currency earned during a game session. Depending on your game, you might not need these methods. Adding currency to a user who has bought them for real money is not affected. So, if you do not have these use-cases, you could think about skipping Azure functions completely.

    If you do, Azure has a free subscription (left side in your screenshot) with a high free contingent of Azure function executions (I think 1 million or something), which also stays free after 12 months, so you should not need to pay something ever.
     
  33. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    Hello @Baroni, is there no email support anymore? I can't find any email in your website. I was using info at rebound games in the past but it seems not active anymore.
    Anyway, Im getting this error

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.GameObjectInspector.ClearPreviewCache () (at <f9102adc00864e0a9c861fc3dd597bda>:0)
    UnityEditor.GameObjectInspector.ReloadPreviewInstances () (at <f9102adc00864e0a9c861fc3dd597bda>:0)
    UnityEditor.GameObjectInspector.OnForceReloadInspector () (at <f9102adc00864e0a9c861fc3dd597bda>:0)
    UnityEditor.AssetDatabase:SaveAssets()
    SIS.IAPProductProvider:OnDeactivate() (at Assets/SimpleIAPSystem/Editor/IAPProductProvider.cs:68)
    UnityEditor.SettingsWindow:OnDisable()

    Im using Unity 2019.4.36f and simple IAP 5.0.2
     
  34. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    Also, is it the receipt validator server package still available?
     
  35. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @newlife, email support was not a thing in the past either (I had a dedicated support forum at this time), but this thread should be used for support since 2021 due to changing the company.

    Unfortunately neither Unity 2019 nor SIS 5.0.x is supported anymore. You will need at least Unity IAP 4.4.0 (and Unity 2020) to release e.g. on Google Play. I do not remember seeing this exception, but there have been multiple bug fixes up to 5.0.7 and later.

    If you mean the php script, that has been replaced with a fully hosted solution including a dashboard. You actually cannot miss it - the "Receipt Validator" service is mentioned in the first post of this thread, on the Asset Store page and on my website. :)
     
  36. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    We had several email exchange in the past, I dont understand you here. Anyway, email support should be the bare minimum for a paid asset. Here you can't even know if you are giving support a a paid customer o not.

    You mean that Unity 2019 and Unity IAP 4.1 is not supported anymore by Google Play?

    I know about that service, but since I have my own server I would like to avoid paying for another one.
    But probably you are not willing to share the package anymore to force people to buy your service.
     
  37. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Maybe my reply to this was kept too short. I know that we had lengthy discussions via email in the past. But with hundreds of customers I am not able to answer the same questions every week, so the dedicated support forum and now this thread is a place where previous answers can be found. I also tried Discord (with invoice verification) but it did not work out for me.

    Yes. Google Play requires their billing v4 which is only included in Unity IAP 4.4.0 upwards, which can only be downloaded in Unity 2020+.

    Not exactly. The php script did not scale to hundreds of purchases per day, nor did it support checking existing transactions because it did not make use of a database. Also no App Store subscription webhooks to detect expiring ones, or user inventory. The new service runs in the cloud and has all of that plus a dashboard monitoring recent transactions. I am not "forcing" anyone - it is quadruple times better than the old one, has a free plan but you do not have to use it at all.
     
  38. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    That's crazy. billing v3 has been released just one year ago (https://developer.android.com/google/play/billing/release-notes)

    So are you willing to share the package or not?
     
  39. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    The php script has not been updated since 2 years and does not work anymore, so no. There are open-source, self-hosted alternatives out there which do the same.
     
  40. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    @newlife I had the same exact problem, there's no other way then upgrading Unity to get access to billing v4. It's a shame what these guys are doing, but I have to say, that an update to 2021 worked out for me, even if I had Anima2d running. It still runs on 2021, nobody know why, but it does somehow, so I had luck.
     
  41. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    Some examples?
     
  42. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    justtime likes this.
  43. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,080
    @Baroni what do you think about this statement on unity doc page?

    Point of validation
    It is best practice to validate the receipt at the point where your application’s content is distributed.

    • Local validation: For client-side content, where all content is contained in the application and is enabled once purchased, the validation should take place on the target device, without the need to connect to a remote server. Unity IAP is designed to support local validation within your application. See Local validation below for more information.
    • Remote validation: For server-side content, where content is downloaded once purchased, the validation should take place on the server before the content is released. Unity does not offer support for server-side validation; however, third-party solutions are available, such as Nobuyori Takahashi’s IAP project.


    Essentially it says that for client side content there is no need to make server side validation.
     
  44. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    If the only reasoning is that it is unnecessary to do server side validation because the content is shipped within the app, it is just wrong. Users are not able to do code modifications and just replace a default prefab with a "paid prefab". However, they can absolutely fake or simulate receipts, or copy save games between devices. And that's where local validation fails completely, in contrast to server side validation.
     
  45. petrit000_unity

    petrit000_unity

    Joined:
    Aug 16, 2018
    Posts:
    1
    Hi, I had my consumable IAPs and my subscription working perfectly. I then added the ReceiptValidatorClient script to the scene. Now after 5 minutes in the Play Store open testing, I get an email saying --------"
    This test purchase was cancelled because it was not acknowledged. You should ensure all purchases are acknowledged so they are not subject to refunds. For more information see https://developer.android.com/google/play/billing/integrate#process. " ------I am using unity version 2021 and Simple IAP newest version. Thank you.
     
  46. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @petrit000_unity, thanks for your message. Could you please provide more information on the exact error, if there is any? Add a Debug.Log to important code and read the device log:

    - in ReceiptValidatorClient.cs, does it enter the try-catch at line 129?
    - if that causes an exception at line 137, whats the value of ex.Message (there is a Debug.Log by default already if you enable Development Mode)?

    Also, please double check the Google key you've entered into the Unity IAP Obfuscator, and verify that it does not contain any unintentional spaces at the beginning or end.
     
  47. Gushmeister

    Gushmeister

    Joined:
    Apr 30, 2018
    Posts:
    51
    Hi @Baroni how do I get the category of a product? I'm adjusting the ShopItem2D-Script, which takes the ID of the current product. But how to get that product's category it is in?

    I want to increase security. Right now I'm doing it so that every product has a unique number, so some collectables like skins or so do have numbers from 1-1000, other special cosmetics for numbers between 1001-2000 and so on. So when I check a product right now, I parse the string into a number and check it against that. But that's totally not the thing I should do I suppose xDDD

    EDIT: Nevermind, I'm sorry, it's so obvious. The parent, that spawns the Shop2D-Items is of type IAPP-Product, so I could get it from there xD

    string categoryParent = Parent.GetComponent<IAPContainer>().category.ID;

    Cool Man, I like how you've written it, that's really put together logically and easily adjustable, so nice Man!
     
    Last edited: Nov 16, 2022
  48. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Or, if you have an IAPProduct (product), by looking through the ScriptableObject settings:
    Code (CSharp):
    1. IAPCategory category = IAPManager.GetInstance().asset.categoryList.Find(x => x.referenceID == product.category.referenceID);
    Did you write a review on the Asset Store yet? :p
     
  49. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there, @Baroni! I have many users of my app(Android) and sometimes they complain about losing app's purchased items state(restore transaction doesn't work). I tried to figure it out and found that sometimes they similarly lost some app's settings. For both cases Player Prefs is using. In this article stated that Plaer Prefs "can be deleted by accident since they’re saved outside of the project and managed by your OS". So, how do you think, may be it worth to offer some option for where DBManager will save?
     
  50. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,260
    Hi @justtime, it is correct that users can lose (PlayerPrefs) data e.g. by clearing app cache or simply uninstalling the app.
    Could you explain what you mean by that - do you mean an option to select Google Firebase, Microsoft Azure or Unity Cloud Save (for example)? If so, there is a fully implemented cloud save provider supported already: PlayFab. Other implementations would basically mean I would have to include a lot of 3rd party SDKs for each provider in Simple IAP System, which is not something I would like to do, nor be able to support in the longer term.

    For custom implementations mentioned above, the DBManager already comes with Read() and Overwrite(external data) methods, for reading local data (your code: sending it to cloud save), as well as (your code: receiving data from cloud save) and overwriting local DBManager content. Please let me know if you need something else.