Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

After update to 3.0.1 through Package Manager, namespace Security is no longer available in editor

Discussion in 'Unity IAP' started by RGV, Mar 18, 2021.

  1. RGV

    RGV

    Joined:
    Jan 25, 2016
    Posts:
    48
    Having the new asmdef Unity.Purchasing.Security, which isolates so called namespace, we've seen this asmdef has not Editor checked as a platform.
    So, even we reference such an asmdef from ours, our code now can't find many references when it comes to local receipt validation or so. This is just an editor compiler problem, we guess, but solving it just confining every single failing piece with #if !UNITY_EDITOR macros and fixing things here and there is not such a maintainable practice, in our humble opinion. We may totally miss something at this point.
    How's that supposed to be fixed?

    Some examples our editor code uses Unity.Purchasing.Security in:
    • InvalidReceiptDataException, InvalidBundleIdException, MissingStoreSecretException, IAPSecurityException.
    • CrossPlatformValidator.
    • IPurchaseReceipt, GooglePlayReceipt.
    • StandardPurchasingModule (which is not in Security namespace, we're missing something on this maybe?).
    Thanks in advance and hope that's legible enough despite my language constraints.
     
    francisIsFine likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @RGV Sorry to hear you are having these issues, we have heard of similar reports but I haven't been able to reproduce yet. Can you provide the specific errors and steps to reproduce on a new project and provide it as a zip file?
     
  3. RGV

    RGV

    Joined:
    Jan 25, 2016
    Posts:
    48
    I'll report tomorrow as my team is now off. Thanks! :)
     
  4. RGV

    RGV

    Joined:
    Jan 25, 2016
    Posts:
    48
    Totally unable to reproduce it on a new project. Just when migrating the actual one. We're trying to fathom what's happening here.
     
  5. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    61
    If you use asmdef in you game code scripts, then you should add references to some of the new asmdef's from new unity iap.
    upload_2021-3-22_15-51-16.png
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, I would need specific steps.
     
  7. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    151
    Hi @RGV ,

    We had to move some of the code from Security into Editor for the Generation of "Tangle.cs" files via the receipt validation Obfuscator.

    Is the feature you may be missing in Editor mode (I'm assuming for Play-In-Editor?) related the CrossPlatformValidatior?

    Also, moving this feature from .dll files to C# code bounded in .asmdefs seems to have revealed some bugs that oddly didn't manifest before, but should have. We found an issue regarding this not being accepted by the complier and we're fixing it for the next version.

    In the meantime, you could try to manually edit your (GooglePlay/Apple)Tangle.cs files and remove the #if ... #endif blocks and see if that helps, or copy those blocks around your CrossPlatfromValidator code calls in your own c# files. If this works for you, this is indeed the going to be fixed in the next release.

    Sorry for the inconvenience. Please let me know if this helps!
     
    JeffDUnity3D likes this.