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(); }
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); } }
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); } }