public void AppKeyCallback_DontAllow(AppKeyManager.DontAllowReasons reason)
    {
        // This will run when AppKey is not installed or not running.

        // <Your code to DISABLE features for AppKey users goes here.>

        Debug.Log("AppKey access not allowed for reason of "+reason);
    }
Beispiel #2
0
        public void Serialize()
        {
            string bridgeName     = "Test Bridge1";
            var    expectedResult = new AppKeyManager();

            expectedResult.AddKey(bridgeName, "TestKey-123");



            var testObj = new AppKeyManager(true);

            Assert.AreEqual(expectedResult.GetKey(bridgeName), testObj.GetKey(bridgeName));
        }
Beispiel #3
0
    void Start()
    {
        instance = this;

        if (LOGD)
        {
            Debug.Log("AppKeyManager.Start Called");
        }

        if (gameObject.name != "AppKeyManager")
        {
            Debug.LogError("AppKeyManager: Game object name must be AppKeyManager");
        }
        mAppKeyPluginClass = new AndroidJavaClass("com.appkey.plugin.AppKeyPlugin");
        mAppKeyPlugin      = mAppKeyPluginClass.CallStatic <AndroidJavaObject>("INSTANCE");
        mAppKeyPlugin.Call("setDebugLogging", LOGD);
        mActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic <AndroidJavaObject>("currentActivity");
        mAppKeyPlugin.Call("init", mActivity, instance.AppID, instance.UserAnalytics);
        StartCoroutine(CheckAppKeyDelayed());
    }
Beispiel #4
0
    //void Start() {
    //	AppKeyManager.appKeyEnabledEvent += AppKeyCallback_Enabled;
    //	AppKeyManager.appKeyDisabledEvent += AppKeyCallback_Disabled;
    //}

    void OnGUI()
    {
        GUI.skin.label.fontSize  = 20;
        GUI.skin.button.fontSize = 20;

        GUI.Label(new Rect(50, 50, 600, 200), "AppKey status updated on app start and/or resume");
        GUI.Label(new Rect(50, 100, 600, 200), "Status = " + AppKeyResult);
        GUI.Label(new Rect(300, 200, 400, 100), "PromptUser tells the user how to enable AppKey");
        if (GUI.Button(new Rect(50, 200, 200, 100), "Call PromptUser"))
        {
            AppKeyManager.PromptUser();              //Use text set in prefab
            //AppKeyManager.PromptUser("[some awesome thing]");  //Override prefab text
        }

        //OpenAppKey opens appkey to the store view. Typically not used but available if it works for your UX
        //GUI.Label(new Rect(300, 400, 340, 100), "OpenAppKey opens AppKey to the store view");
        //if (GUI.Button(new Rect(50,400,200,100),"Call OpenAppKey")) {
        //	AppKeyManager.OpenAppKey();
        //}
    }
 public void AppKeyCallback_DontAllow(AppKeyManager.DontAllowReasons reason)
 {
     Debug.Log("AppKey access not allowed for reason of "+reason);
     AppKeyResult="Don't allow for reason of "+reason;
 }