update: fix auth api params

Signed-off-by: huyufei <yufei.hu@castbox.fm>
deeplink
胡宇飞 2024-05-13 13:43:42 +08:00
parent 0d47b48058
commit 629687b3a6
2 changed files with 19 additions and 1 deletions

View File

@ -24,5 +24,22 @@ namespace Guru
return config;
}
/// <summary>
/// 直接构建 JSON 串
/// </summary>
/// <returns></returns>
public static string BuildJson()
{
var config = Build().ToJson();
return config;
}
public string ToJson()
{
return $"{{\"firebaseAppInstanceId\":{firebaseAppInstanceId},\"idfa\":{idfa},\"adid\":{adid},\"gpsAdid\":{gpsAdid}}}";
}
}
}

View File

@ -20,9 +20,10 @@ namespace Guru
var data = new Dictionary<string, object>()
{
["secret"] = IPMConfig.IPM_DEVICE_ID,
["eventConfig"] = EventConfig.Build().ToString(),
["eventConfig"] = EventConfig.BuildJson(),
};
var json = JsonConvert.SerializeObject(data);
Debug.Log($"[SDK] --- AuthUserRequest json: {json}");
var request = new UnityWebRequest(RequestURL, "POST");
request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(json));
request.downloadHandler = new DownloadHandlerBuffer();