Beispiel #1
0
        void Login(SDKLoginRequest loginRequest)
        {
            string jsonString = JsonUtility.ToJson(loginRequest);

            sdk                     = ImmersalSDK.Instance;
            request                 = UnityWebRequest.Put(string.Format(ImmersalHttp.URL_FORMAT, sdk.localizationServer, SDKLoginRequest.endpoint), jsonString);
            request.method          = UnityWebRequest.kHttpVerbPOST;
            request.useHttpContinue = false;
            request.SetRequestHeader("Content-Type", "application/json");
            request.SetRequestHeader("Accept", "application/json");
            request.SendWebRequest();
        }
Beispiel #2
0
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            if (instance != this)
            {
                Debug.LogError("There must be only one ImmersalSDK object in a scene.");
                UnityEngine.Object.DestroyImmediate(this);
                return;
            }

            if (developerToken != null && developerToken.Length > 0)
            {
                PlayerPrefs.SetString("token", developerToken);
            }
        }
Beispiel #3
0
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            if (instance != this)
            {
                Debug.LogError("There must be only one ImmersalSDK object in a scene.");
                UnityEngine.Object.DestroyImmediate(this);
                return;
            }

            HttpClientHandler handler = new HttpClientHandler();

            handler.ClientCertificateOptions = ClientCertificateOption.Automatic;
            client = new HttpClient(handler);
            client.DefaultRequestHeaders.ExpectContinue = false;

            if (developerToken != null && developerToken.Length > 0)
            {
                PlayerPrefs.SetString("token", developerToken);
            }
        }