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

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    BTW, they changed it once again. There are several console warnings.

    Assets\SimpleIAPSystem\Scripts\UIShopFeedback.cs(59,50): warning CS0618: 'Object.FindObjectOfType(Type)' is obsolete: 'Object.FindObjectOfType has been deprecated. Use Object.FindFirstObjectByType instead or if finding any instance is acceptable the faster Object.FindAnyObjectByType'

    Assets\SimpleIAPSystem\Scripts\UISceneSwitcher.cs(19,38): warning CS0618: 'Object.FindObjectsOfType<T>()' is obsolete: 'Object.FindObjectsOfType has been deprecated. Use Object.FindObjectsByType instead which lets you decide whether you need the results sorted or not. FindObjectsOfType sorts the results by InstanceID but if you do not need this using FindObjectSortMode.None is considerably faster.'
     
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    You will want to either subscribe to IAPManager's purchaseSucceededEvent, which is fired every time a purchase went through, in your own script that then calls the ES3 methods, or put the ES3 code into the IAPListener's HandleSuccessfulPurchase method and switch-case directly. This method is invoked by the purchaseSucceededEvent already.

    Note that duplicating existing functionality (basically the Lives currency) is not a good idea. Instead of the ES3 method you could just use SIS.DBManager.GetCurrency and ConsumeCurrency in your code. Ensure that if Lives are consumed, consume them in the DBManager (using the ConsumeCurrency method mentioned) as well.

    The upgrade notes mention:
    • ShopManager class was renamed to UIShopFeedback. If you have used that in your shop scene, check its references to the message/confirm window and message label.
    So no, but the ShopManager script should be replaced by the UIShopFeedback component which contains the same plus other references. Please see the example scenes for samples. In general, you might want to create a new project with only the latest Simple IAP System to compare what changed and how it is set up in the samples, without the need to switch back and forth during the upgrade.

    From the upgrade notes:
    • Use the IAPManager.RestoreTransactions method instead of "purchasing" a "restore" product
    In old versions, trying to purchase a product with the identifier "restore" would just call the IAPManager.RestoreTransactions method. You can still do it that way if you wish to, and add a call to IAPManager.RestoreTransactions in the IAPListener's HandleSuccessfulPurchase method for the "restore" product. Or, use the new way and call that method anywhere in your game (e.g. in your options menu) or via the UIButtonRestore component as done in example scene "RestoreTransactions".

    Thanks, what Unity version is that on?
     
  3. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I'd prefer to just do it the old way. I have a prostore scene set up which is the only place any transaction is made. And the transaction is just to buy the game. No virtual currencies or anything. So, the code would be?

    Like this in the IAPListener?
    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!");
    IAPManager.RestoreTransactions();
    break;
    default:
    ShowMessage("Product (" + productID + ") bought!");
    break;
    }
    }
    =========================================================
    Unity 2023.1 gives the warnings. There's also a couple of symbol warnings after building a project. I have these same warnings in every plugin i use. It really annoying that unity constantly changes things. The really need to not do that.
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Yes, exactly like that.

    I hate Unity 2023 (and 2022.3) already. Thanks, looking into it for the next update.
     
  5. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    OK, I thought I had it. In the editor, after I press the button to buy the product, it gives this response.

    IAPListener reports: HandleSuccessfulPurchase: proversion
    Value for key transactionReceiptSignature was null, it will not be included in event transaction.
    Value for key transactionServer was null, it will not be included in event transaction.
    ======================================================
    The pictures show some more info from unity itself.
    ==================================
    the IAPlistener is
    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!");
    IAPManager.RestoreTransactions();
    break;
    default:
    ShowMessage("Product (" + productID + ") bought!");
    break;
    }
    }
    =========================================================
    I do have ant-cheat tool kit as well. i set it up as your instructions say. This has got to be a simple fix. Now, after purchasing the product in the editor, it does correctly show it was purchased.

    However, after downloading the game from play store, the button to buy the product does nothing. When I click on it it does nothing. Also, the restore entry/button does not show up either.
     

    Attached Files:

    Last edited: Jul 17, 2023
  6. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    One more picture.
     

    Attached Files:

  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    @RandomCharacters Your setup looks good, thanks for the screenshots. I am not able to see any problems on them.
    I have not seen these before, but it seems they are coming from Unity IAP and Unity Analytics as mentioned here. Are you using the latest version of Unity IAP (4.9.3+) which does not even include Unity Analytics?

    You will want to inspect the device log to see whether Unity IAP has been successfully initialized at all. More information on what to check can be found in this documentation section. Unfortunately not being able to buy a product on Google Play can have several reasons, which require deeper investigation and I am unable to take a wild guess. Note that in the Unity Editor all purchases go through using a fake store - there is no real billing, you have to verify on a real device.
     
  8. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I think I found the issue (see next message).

    However, when I build a Mac build (from windows 11), it fives this error.
    IAPListener.cs(51,32): error CS0117: 'IAPManager' does not contain a definition for 'RestoreTransactions'

    When I go to the script, I do see it.
    #if SIS_IAP
    /// <summary>
    /// Restore already purchased user's transactions for non consumable IAPs.
    /// If receipt validation is used, the restored receipts are also getting validated again.
    /// </summary>
    public static void RestoreTransactions()
    {

    In the past I could build to Mac from windows with SIAP. Now it gives and error.
     
  9. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    - I am using latest unity IAP 4.9.3. Everything in the package manager is the latest.
    - For some reason in the products area, it always defaults back to 'choose category'. See screenshots. Even after I set it to 'IAP-Cat', later it will go away. Is this normal?
    ====================
    I did uncomment the 'define' that is in your notes because I have revenue validation. Then it gave an error, so I clicked on the obfuscate license and apple license keys. After I did that, the nulls went away. (see screenshot). So, I guess that was the issue. However, after downloading from the play store, the issue still exists. When I click on the buy button, nothing happens and the restore doesn't show up.

    ================================
    (Btw the way, in your online documentation, it is different from the script. Must be old and outdated).
    https://flobuk.gitlab.io/assets/docs/sis/features/validation
    ======================================
    Any other ideas? I have several apps I need to update to newest version of SIAP.
     

    Attached Files:

  10. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    That's weird, do you have a Mac build platform and the SIS_IAP scripting compilation define added to it under Build Settings?

    That's normal, the selection is not remembered.

    Did you debug the device with Development Build enabled? Any device messages?

    The scripting define changed some time ago however the line number and instructions are still valid.
     
  11. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I didn't change anything to mac. The only thing of yours I changed was decommenting this line and the code for the purchase (previous message).

    As far a debugging with development built, no. That's the next thing I'll do (I've spent the day also trying to export to UWP but apparently the unity guy says there is a bug that won't let me. Sheez). Let me try that and I'll tell you what it says.
     
  12. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    @RandomCharacters Thanks for the additional information. I'm currently on vacation and will try to reproduce the Mac issue when I'm back home next week.

    For the Android issue I am awaiting your debug log response.
     
  13. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Attached is a screenshot from my cell phone using the 'build and run' development build'. It did not give out any errors. However, you can see that the bar in the screenshot did that get any info. Also, there is no restore transaction bar as well.

    then i redid it and that time it had the info for the bar. However, nothing happens when I press the button.

    As far as the log, I'll have to look up how to do that again and post it.
     

    Attached Files:

    Last edited: Jul 18, 2023
  14. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    OK, I have been messing around with a simple project. I do have obfuscator and anti-cheat tool kit in there. ANTI is connected like your instructions say. I have turned off obfuscator. I still get same results. So, as far as the debugging goes, what exactly do you want and where to find it? Sorry, but my debugging skills are lacking.

    I have run the game with development build through my samsung phone. No errors.
     
  15. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    @RandomCharacters If your store connection to Google Play is not working correctly, you should at least get a popup that says "Billing is not available". The requirement for this is to have a UIShopFeedback component in the scene with corresponding Window prefabs assigned. If you do get nothing at all, then you either do not have a UIShopFeedback component, or the Buy button on the item's ShopItem2D component is somehow broken. It is more confusing since you've previously shown that the purchase process works correctly in the editor, just not the device.

    Also, since you have enabled the "Fetch" checkbox on your product, it should request and receive localized prices and titles from Google Play. Unless you're located in the US, this should mean it should display a different price. Which in turn then means, the Google Play store connection is indeed not working correctly.

    You would run the "adb logcat -s Unity" command to filter for Unity application only logs, then watch out for Unity IAP messages or any exceptions. Unity IAP should print that it received a product (the pro version product) and that it initialized successfully. If it says "no products available" instead, you will know that there is something missing in your Google Play setup.
     
  16. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    I installed the android logcat from the package manager. I did see an error there in red. I'll be honest and say I have no idea of how the debugging stuff works. Anyways, here is that. I'll see about getting what you asked next.
     

    Attached Files:

  17. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Part 2: The new red shows what happens when I run the game in Develpment mode, attached to cell phone.

    The first red section is when I go into the scene with the store.

    The second red is after I press the buy button in the store. It does nothing in the game but does gives this error.

    Hope this helps some.
     

    Attached Files:

  18. ewagstaff

    ewagstaff

    Joined:
    Apr 21, 2017
    Posts:
    13
    Hello again! Wondering if you can help with some weird inconsistent behavior we are seeing when attempting to purchase a consumable item through Steam using this plugin.

    When we're testing locally, it appears to work fine -- attempting to purchase will say "Billing not enabled" because it's not running from Steam. When we create our build and upload to Steam, clicking a button will fire the IAPManager method to purchase:

    Screenshot 2023-07-20 at 10.49.11 PM.jpg

    Sometimes this works with no issues! And it shows the purchase overlay as expected.

    Screenshot 2023-07-20 at 10.51.25 PM.jpg

    But other times, this modal will start to load, then will cancel out and instead the Steam client just loads on top of the game. Like it'll just open the Steam store on top of the full screen game:

    Screenshot 2023-07-20 at 10.55.09 PM.jpg

    Have you seen this behavior before? Anything I can do to make the purchasing more reliable? For context, I am using the Unity LTS version 2021.3.27f1. Building and running on a Mac. I've added logs and I know the script is getting to the line in IAPManager.cs where this method runs:

    Code (CSharp):
    1. controller.InitiatePurchase(p);
    That method runs no matter whether it's a successful purchase or the cancelled one. However, if it's a successful purchase, HandleSuccessfulPurchase runs in IAPListener.cs. In the cancelled case, neither HandleSuccessfulPurchase nor HandleFailedPurchase run.

    Maybe even more helpful context: Once the game displays this cancel behavior once, the player cannot retry the payment. If they try, the screen goes dim for a moment while the overlay tries to open, but then does not. Contrast that to when payments are successful: the player can keep purchasing repeatedly and the overlay works as expected (until it hits that cancelling behavior).

    Thanks for considering this weird issue!
     
    Last edited: Jul 21, 2023
  19. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Note: writing this on a Sunday, as I am currently still on vacation and will be on the road tomorrow while travelling back home. Usually weekend replies are part of private support, but I didn't want to have you wait until Tuesday.

    @RandomCharacters thanks for the screenshots! Since the first exception is thrown during IAPManager initialization of the DBManager, there is definitely something wrong with local storage, which could then result in product storage and later callbacks not registering correctly. Unfortunately the log does not include line numbers, so I do not know where exactly the NRE happens - are you able to enable "Script Debugging" besides Development Build to include them? Otherwise, I would assume that either the DBManager tries to access a local file that does not exist, or wants to write bad data - both cases should not happen. Eventually you could send a screenshot of your IAPManager prefab with the DBManager in the inspector for me to reproduce?
    Your second exceptions screenshot could be caused by the failed initialization, but also if you have multiple IAPContainer components in the scene (or an IAPContainer and manually placed IAPItem both with the "proversion" product identifier). This is something you would want to double check.

    @ewagstaff Hey! Thank you for the detailed explanation - unfortunately I have not heard of this before. Since you wrote that "controller.InitiatePurchase" works in all cases including the cancelled one, it means that Unity IAP always initializes with the Steam store correctly (otherwise the controller value would be null), and the issue occurs afterwards, when trying to initiate the purchase. This makes me think that the issue is with Steamworks.NET. When the "cancelled" purchase happens, in SteamStore.cs, could you verify the values of startPurchaseHandle within the Purchase() method and pCallback value within OnPurchaseStarted() method? Do their values differ in any way when made in a regular purchase call?
     
  20. ewagstaff

    ewagstaff

    Joined:
    Apr 21, 2017
    Posts:
    13
    Really appreciate the weekend response! Sorry to add any troubleshooting to your vacation, I'm fine to wait until Tuesday for the followup.

    I added logs in SteamStore.cs like you suggested.

    - It looks like startPurchaseHandle's value is always a string of numbers (like 1059666600482894409 and 11071249043178512689) both in the successful case and the cancelled case.
    - pCallback is always Steamworks.SteamInventoryStartPurchaseResult_t, and
    pCallback.m_result is always k_EResultOK, in both successful and cancelled cases.
    - bIOFailure (which you didn't ask about but seems to have some failure handling near pCallback) is always false, so it's not a factor either.

    I'm pretty puzzled! I don't see much of a difference in the logs between the successful and cancelled calls, or anything that points to an error. Anything else I should try logging?
     
  21. Phan-Phantz

    Phan-Phantz

    Joined:
    Nov 11, 2015
    Posts:
    17
    Hello, I've been struggling with testing In-App purchases on iOS platform. I have created in-app purchases in Apple Store Connect with the same product IDs as in the project setting. But when tested on the actual device, It always says 'Unavailable product coins-coins and 'No products available for purchase!'. The log in Xcode says:

    UnityIAP: Requesting 7 products
    UnityIAP: Requesting product data...
    UnityIAP: Received 0 products


    I suspect that this might be a configuration problem on the Apple Store Connect side since the same products and code is working fine on Android device and Google Play.

    I have tried :
    - Recheck that the bundle identifier and product IDs matched.
    - Fill in Tax and Banking detail
    - Accepted the License agreement for 'Free Apps' and 'Paid Apps' and received an Active status (green)
    - Created a sandbox tester account and signed out on the test device (The IAP still failed to initialize from the start so it didn't prompt any login popup since the IAP itself is not working) I then tried to sign in to the sandbox tester account from iOS App Store settings manually, still nothing.
    - Published and tested the app from Testflight.

    Am I missing something here? My only clue now is the 'missing metadata' status on the in-app purchases in Store Connect, Do I need to submit the app first in order to test the In-App purchases?
     

    Attached Files:

  22. cgutierrez71

    cgutierrez71

    Joined:
    Oct 15, 2013
    Posts:
    69
    Hi Florian, please read our conversation it's regarding to the payment. Everything is working.
     
  23. Phan-Phantz

    Phan-Phantz

    Joined:
    Nov 11, 2015
    Posts:
    17
    Okay, My problem was I had to fill in all the information of each in-app purchase including Availability, Pricing, Tax, Screenshot, and Description to get a 'Ready for Submit' status for that item in order to be discoverable by Unity IAP.

    It would be helpful to others if you could include this fact in the GitLab documentation.
     
  24. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    @ewagstaff Thanks for the additional logs output. My Mac device is not setup for Steam, but I would try to reproduce this on my Windows machine. Before I do so, could you confirm whether you are actually buying the consumables multiple times until the issue occurs, or is it sufficient to just invoke the purchase flow without buying anything? How many times, roughly, and what Steamworks.NET version are you using? Thank you!

    @Phan-Phantz Sorry for the missing response as I was not at home yesterday. I will take a note to include this in the iOS documentation, thank you!
     
  25. ewagstaff

    ewagstaff

    Joined:
    Apr 21, 2017
    Posts:
    13
    Thanks for taking a look! I'm able to trigger the error by opening the purchase modal and just cancelling the purchase, no need to actually buy. Again, the error appears somewhat variable so sometimes I see it the first time I click to purchase, other times I have to open the modal and cancel a couple times until it triggers the Steam store to pop over the game.

    The installed Steamworks.NET version: Version 20.1.0 -- I do see that 20.2.0 has been released. Do you think it's worth trying the latest?

    It's also possible that this is a weird quirk of it being a sandbox purchase (as the game is still in development) and not a true purchase, but it does make things hard to test.
     
    Last edited: Jul 25, 2023
  26. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Thanks. i spent the last week trying to figure this out. I uploaded 2 apps with everything working in Unity, but not after I download and play. This is what I did. I'll know more later this week when I rest this out some more.

    Looking at your message, i think the issue is data on the phone itself. So what i did was
    1) goto setting icon
    2) Click Apps
    3) Click on name of game
    4) Click on storage
    5) Click 'clear cache'
    6) Click 'clear data'
    7) Click back buton
    8) Click 'force stop'
    9) click 'uninstall'.
    10) Download and install new version from Play Store.

    After doing that, the IAP store in the 2 apps seem to work now. they display right and does detect if the game was bought. So, if anyone else has this issue, that was my fix. I'll know for sure in a few days after testing some more.

    Just updating the app to a new version did not work. Deleting the old version and redownload a new version did not work. What did work was clearing all of the saved data and then reinstalling.
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Hi @ewagstaff, I tried to reproduce the issue without success on my Windows 10 machine and SteamworksNET 20.1.0. I opened the purchase modal every 5 seconds, for 3 minutes, so about 40 times total without seeing the store popup once. Do you have a Windows machine too or would you want me to test on my Macbook? I would be able to do that somewhen next week.

    I do not think that SteamworksNET 20.2.0 makes a difference as it does not contain any IAP fixes. Maybe you would want to open an issue on the SteamworksNET github about this though?

    @RandomCharacters Thanks for confirming that clearing local data solved it. While in development and when changing storage options on the DBManager, local data should always be deleted manually. In production these settings should obviously not change anymore, except with an implemented data migration scenario.
     
  28. ewagstaff

    ewagstaff

    Joined:
    Apr 21, 2017
    Posts:
    13
    Thanks for testing so thoroughly! I'll try on Windows as well and get back to you.
     
  29. ewagstaff

    ewagstaff

    Joined:
    Apr 21, 2017
    Posts:
    13
    Small update: Tested on Windows, and the same build that was working intermittently on Mac does not open the purchase modal at all on Windows. Neither the purchase modal nor the store appear over the game, though all the logs look like what I described in the "Cancelled" case: StartPurchaseHandle returns a numeric ID and pCallback returns an OK response.

    However on Windows, the Steam overlay does not appear to work either, so there might be a deeper issue with my config for that system. Strange that works on Mac and not Windows though.
     
    Last edited: Jul 27, 2023
  30. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    yeah, i can confirm my issue was bad data. on each game after the new version, i had to delete the data from android phone. now i have to get them to work on uwp.
     
  31. gklei

    gklei

    Joined:
    Aug 7, 2020
    Posts:
    2
    Hi @Baroni,

    I just purchased the Simple IAP System asset and am getting five errors in the console immediately after importing from the Package Manager window (right at the "Finally, add Simple IAP System to your project from the Packages:My Assets section" step from your documentation). I'll upload a screenshot, but they all seem to be related to the same method and are coming from the same file; here's an example of one:

    Code (CSharp):
    1. Assets/SimpleIAPSystem/Editor/IAPSettingsProvider.cs(547,28): error CS0117: 'PlayerSettings' does not contain a definition for 'SetScriptingDefineSymbolsForGroup'
    I'm using Unity version 2021.3.26f1

    I tried installing this on a much more basic sample project running the same version of Unity and I'm not seeing these errors show up. Is there anything you can do to help me successfully import the Simple IAP System package? It looks very well designed and I'm looking forward to using it if possible!

    I'm more than happy to provide additional information if it would help, and thank you in advance for your support.
     

    Attached Files:

  32. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Hi @gklei, thank you posting here! "PlayerSettings" is a class that exists in the Unity Editor and used by SIS to enable functionality based on Scripting Define Symbols. Could it be that you have another "PlayerSettings" class in your project that does not use its own namespace?
     
    gklei likes this.
  33. gklei

    gklei

    Joined:
    Aug 7, 2020
    Posts:
    2
    That was it! Wow, thank you so much for your help—I can't tell you how much I appreciate your quick response and immediate solution. I was convinced the issue was not with this package, but I have no idea how long it would have taken me to fix this on my own. Looking forward to getting IAP setup!
     
    Last edited: Aug 1, 2023
    Baroni likes this.
  34. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    @Baroni does this work for oculus quest, and does it work for the AppLab quest store? We want to purchase this for our business to handle all IAP across our platforms, but its important to know if it works on AppLab or not?

    There is no difference in performing applab IAP vs regular store IAP via the quest documentation, so I assume it works but want to know for sure before purchasing multiple seats.

    I know AppLab does not allow subscriptions, other than that I cant find any differences.

    Oculus changes means to release on the store you have to make it through the Oculus Start program, meaning more and more people will be using AppLab to distribute at one point or another in their lifecycle- so I think if you are unsure about the answer to this its an important question to solve to ensure viability of this asset going forwards for users

    Thanks for any help you can provide
     
    Last edited: Aug 1, 2023
  35. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    Using android on a cell phone, if I use the test accept, is it supposed to be for a set period of time or infinite? So, i i but the app using the test, will Play Store reverse it in a few minutes? or will it be considered purchased indefinately?
     
  36. unity_E689A8827B3C59AC4AA1

    unity_E689A8827B3C59AC4AA1

    Joined:
    Aug 2, 2023
    Posts:
    12
    We get "failed to decompress package" when trying to import the virtual reality package using latest version - we specifically bought our seats because of VR - please advice how to fix @Baroni
     
  37. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    I have had a similar request for this a few weeks ago, but unfortunately have not heard back from the user. Since the Oculus Quest uses the same SDK as other Oculus devices (I own a Rift, not a Quest), Simple IAP System works for the Quest. Also, the AppLab Quest store does not have separate SDKs and still uses the Oculus Platform SDK for in-app purchases, so it works with Simple IAP System as well. It might be a good idea to update my documentation pages to reflect this way of publishing in the near future.

    @RandomCharacters Test purchases on Google Play are persistent. If you wish to cancel a non-consumable purchase and test again, you have to log into the Google Developer dashboard, orders section, select the transaction and press the refund+revoke action.

    @unity_E689A8827B3C59AC4AA1 What Unity version are you on? I cannot reproduce the issue locally. Did you rename the Simple IAP System asset folder or move it somewhere else? Please try navigating to SimpleIAPSystem > Editor > Packages and double click the "VR" package manually.
     
  38. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    @RandomCharacters Test purchases on Google Play are persistent. If you wish to cancel a non-consumable purchase and test again, you have to log into the Google Developer dashboard, orders section, select the transaction and press the refund+revoke action.

    Ok, mine are not persistent. After a few minutes google sends an email letting me know the purchase was cancelled. It does this will all of the apps I have. I am guessing there is something I am missing. I'll try to post the actual email here to help out. I am thinking that something is not being done to confirm the purchase from the script.
     
  39. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    How are we meant to select quest, only standalone and WebGL shows up in the settings? in general the oculus documentation you have provided does not show how to setup quest at all, is there any docs for that because its different from the rift and not clear what to do

    @Baroni
     
  40. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Test purchases go through a speed up process and if not confirmed, are cancelled within a few minutes. This means your Unity IAP transaction was not acknowledged and is therefore refunded by Google Play automatically. Simple IAP System and Unity IAP do the acknowledgement automatically, but if not, it usually means you might have a Null Reference Exception or other error in your ProcessPurchase method that prevents Unity IAP from finishing the transaction and reporting back to Google Play.

    Well, there is no "Quest" platform in Unity. My documentation for the Oculus Store shows that the Standalone platform should be selected, Oculus VR SDK added and the produced .exe build uploaded to Oculus. I do not think this differs from the Quest... you have to upload the build to Oculus after all.

    There are a few videos on YouTube which explain the steps specific to Quest 2 better though. Note how at the end of that video, the developer builds an application for Oculus on Standalone. However, it seems that when side-loading to Quest the Android platform is required, I will have to check this.
     
  41. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    You cannot upload or build standalone platform for quest. It requires android. You really need to update your documentation and at least try this process yourself as it sounds like you are "supporting" quest but not actually tried the process yourself. We cannot build a .exe for android so can you please explain in better detail how to exactly use this for quest?

    So if we select Oculus for standalone and build an android .apk, your plugin is supposed to work? Am I understanding that correctly?

    Otherwise we will have to refund the seats as it doesnt seem this is actually built or tested for the target platform in question...
     
  42. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    So, what you are saying is in one of the scripts under a particular method, it needs to be modified to acknowledge the transaction. Where would be a good place for me to start looking for that?
     
  43. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    I am supporting the Oculus platform, which has been tested on PC and on an Oculus Rift, as mentioned previously. I gave advice to other VR developers about Oculus Quest in the past and did not hear back, so I am unaware if there are major differences between them, although they share the same SDK. Documentation update is noted.

    I have just ordered a Quest 2 to do this, which should arrive early next week. I hope you understand that without demand and feedback like yours (thank you!), I cannot simply buy all available VR headsets on the market in the current economic situation.

    Currently it seems that there is a minor editor code change necessary - adding a Scripting Define Symbol to Android - for the Oculus integration to compile there too. I will be able to report back after testing next week, but if you want to do this yourself, I could also send you the files in a PM in advance. Or you could go the refund way, of course.

    @RandomCharacters No, I was saying that Simple IAP System and Unity IAP do this for you. But they can't, if you are having an unrecoverable error. You have to debug and watch the device log for this to find out whether there are any errors.
     
    MadeFromPolygons likes this.
  44. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    @Baroni thanks for the prompt response - I totally understand the situation regarding not knowing what isnt reported so no worries there.

    Im happy to assist however I can to help you get Simple IAP to the point where its frictionless to integrate for the quest, so if there is anything you need from me please let me know and ill get back to you ASAP.

    We ultimately would prefer not to refund as simple IAP works well for the other platforms, it would be great if we can use a single asset to cover everything and really its only the VR side of things that is currently in need of a bit of love.

    also just to note, "unity_E689A8827B3C59AC4AA1" was also me (my work email) - the decompress package issue seems to be resolved by reopening unity so just FYI its probably not a real bug (as in the decompress issue is probably a unity problem more than your problem).

    Thanks and if its easier we can take this to an email chain if you would prefer. If theres a follow up to this I will email you via my work email, along with the relevant details to prove asset store purchases etc

    Thanks and look forward to getting this resolved and the documentation modernised :)
     
  45. WARZOOMCOM

    WARZOOMCOM

    Joined:
    Nov 19, 2022
    Posts:
    10
    Hello. I am using simple IAP system and I am going to integrate it into steam store(not playfab). This is desktop game for windows.

    upload_2023-8-4_12-19-11.png

    I followed all of guides but after adding into steam this occurs error.

    • your Steamworks app is of type "Game" (not Application since that does not support the overlay)
    • in Steamworks, you've created a Web API Key
    • in Steamworks, your app and package was added to the group with that Web API Key
    • the steam_appid.txt file in your project's root folder contains the correct app ID
    • you have uploaded Items to the Steam Inventory Service using a JSON file (with the correct app ID)
    • in-app product identifiers in the SIS Project Settings matches the ItemDefIds added in Steamworks
    • Standalone billing selection in the SIS Project Settings is set to "Steam"
    • you have placed the SteamManager script into your first game scene and start it from there
    • you have deployed the files at your Steam app location under "\Steam\steamapps\common\< game folder >"
    • you are logged in with your developer account when launching the Steam app
    • you have added the game to and starting from Steam (not Play Mode in Unity editor)
    • if the Steam Overlay (Shift-Tab) still does not open, recheck all app IDs entries!
    Check that the following URL opens correctly when replaced with your app ID and itemDef ID: https://store.steampowered.com/buyitem/appid/itemid/

    upload_2023-8-4_12-16-48.png

    Unity Debug log
    Unity IAP is not initialized correctly! Please check your billing settings.

    I am using Unity 2022.3.5f1.

    Please help me. Thank you.
     
  46. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    @unity_E689A8827B3C59AC4AA1 all good, the Quest 2 arrived today. Currently charging it and will start working on the documentation tomorrow. It is likely that I'll get the integration working next week. If there are code changes required, they'll be on GitHub first (for collaborators, separate purchase on my website) and then on the Unity Asset Store probably a week after that.

    ----------------------------------------------

    Hi @WARZOOMCOM , if you have followed all instructions correctly, unfortunately there is not much I can help out. The instructions were proven to work for Steam Native by multiple users. However, one single wrong setting on Steam can make a difference, that's why the integration can get difficult to debug very quickly. You've copy-pasted the full checklist but did not say anything about it, i.e. does your Steam overlay work when launching from within the Steam app using your Steam developer account?
     
  47. WARZOOMCOM

    WARZOOMCOM

    Joined:
    Nov 19, 2022
    Posts:
    10
    Thank you for your reply.
    I uploaded my game(windows) into steam and after showing "Billing is not available" twice times and payment is working. Please let me know what is the issue. Thanks.
     
    Last edited: Aug 4, 2023
  48. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    There is not enough information to state the exact cause for this, since I cannot look into your project or settings. I can only take a guess. Maybe you did not put the IAPManager and SteamManager into the first scene of your game, but only into your shop scene, so billing is not yet initialized at the time you are trying to make a purchase?
     
  49. FT_Studio

    FT_Studio

    Joined:
    Jul 5, 2016
    Posts:
    5
    Hi there, I'm a Quest user too and it does not work in build.
    I receive the error "Unity Unity IAP is not initialized correctly! Please check your billing settings."

    Another issue I have is when I set encrypt to true in DBManager.
    This is the error I receive on Play in Unity Editor:

    CryptographicException: Bad PKCS7 padding. Invalid length 0.
    Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException (System.Security.Cryptography.PaddingMode padding, System.Int32 length, System.Int32 position) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    Mono.Security.Cryptography.SymmetricTransform.TransformFinalBlock (System.Byte[] inputBuffer, System.Int32 inputOffset, System.Int32 inputCount) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    SIS.DBManager.Decrypt (System.String toDecrypt) (at Assets/SimpleIAPSystem/Scripts/DBManager.cs:942)
    SIS.DBManager.Read () (at Assets/SimpleIAPSystem/Scripts/DBManager.cs:720)
    SIS.DBManager.InitDB () (at Assets/SimpleIAPSystem/Scripts/DBManager.cs:128)
    SIS.DBManager.Init () (at Assets/SimpleIAPSystem/Scripts/DBManager.cs:114)
    SIS.IAPManager.Awake () (at Assets/SimpleIAPSystem/Scripts/IAPManager.cs:165)


    Hope this will be fixed soon, otherwise it's a great asset!
    Thanks in advance.
     
  50. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,261
    Hi @FT_Studio, thanks for writing here. I am currently working on a rework of the VR sample scene using the XR Interaction Toolkit (confirmed working on the Quest 2) to get rid of deprecated components. Unfortunately for testing IAPs, I still have to add some in the Oculus developer dashboard, but Meta fails to update my payment information. Other developers have this issue too so it seems to be a general one.

    Regarding your DBManager error, each time when enabling/disabling encryption you will have to clear local storage since it cannot be read anymore. The documentation says: "It is good practice to clean up that entry by pressing the Clear button (at runtime) or loading the RestoreTransactions example scene between IAP testing." (or completely removing the app from the device). Hope this helps.