Search code examples
unity-game-enginein-app-purchase

Where the heck is Unity's CrossPlatformValidator?


I'm trying to use Unity's excellent new CrossPlatformValidator

(Such as seen ...
http://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html or
https://docs.google.com/document/d/1dJzeoGPeUIUetvFCulsvRz1TwRNOcJzwTDVf23gk8Rg)

But it can't be found! Naturally I am ...

using UnityEngine;
using UnityEngine.Purchasing;

I also tried different stripping and .Net levels. Nothing.

Anyone have a clue about this?

The type or namespace name `CrossPlatformValidator' could not be found. Are you missing a using directive or an assembly reference?


Solution

  • Stuff like this is usually found at UnityEngine.Experimental but it wasn't there when I looked so I guess it is not a new feature.

    1. You can find it by going to Windows -> Services. Sign in on the Window displayed, usually on the right.

    2. Create a Project ID on that Window.

    3. Click on In-APP Purchasing. It is checked to OFF, click on it then click Enable.

    Note: You must Sign in to be able to Enable it and you must Enable it before you can use it from Script.


    Finally, the completely undocumented namespace is:

    using UnityEngine.Purchasing.Security;

    note that one can see this in the generated "tangle" files, for example, if one forgets it. :/