+ Add EventConfig data on anonymous login.
parent
714d1edf68
commit
55352073f8
|
|
@ -1,11 +1,12 @@
|
|||
using System.Text;
|
||||
using Firebase.Crashlytics;
|
||||
using Guru.LitJson;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace Guru
|
||||
{
|
||||
using System.Text;
|
||||
using Firebase.Crashlytics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
/// <summary>
|
||||
/// 中台匿名授权用户请求
|
||||
/// https://docs.google.com/document/d/1yRE0HQTwaDfBeH7Zd1li1Xr8JIdfqkz3ixqdjD-aH44/edit#heading=h.eispbvmfw5oo
|
||||
|
|
@ -16,9 +17,15 @@ namespace Guru
|
|||
|
||||
protected override UnityWebRequest CreateRequest()
|
||||
{
|
||||
JsonData jsonData = new JsonData {["secret"] = IPMConfig.IPM_DEVICE_ID};
|
||||
var data = new Dictionary<string, object>()
|
||||
{
|
||||
["secret"] = IPMConfig.IPM_DEVICE_ID,
|
||||
["eventConfig"] = EventConfig.Build(),
|
||||
["appSource"] = "App"
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(data);
|
||||
var request = new UnityWebRequest(RequestURL, "POST");
|
||||
request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(jsonData.ToJson()));
|
||||
request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(json));
|
||||
request.downloadHandler = new DownloadHandlerBuffer();
|
||||
request.SetRequestHeader(IPMConfig.Header_Param_ContentType, IPMConfig.Header_Value_ContentType);
|
||||
request.SetRequestHeader(IPMConfig.Header_Param_APPID, IPMConfig.IPM_X_APP_ID);
|
||||
|
|
|
|||
Loading…
Reference in New Issue