question

pawelwedrowski avatar image
pawelwedrowski asked

Unity WritePlayerEvent invalid input parameters

public void LogRaceStart(string playersCarName, string category)
{
    var eventData = new Dictionary<string, object>
    {
        {"PlayersCarName", playersCarName},
        {"Category", category}
    };

    SendEvent("Race_Start", eventData);
}


private void SendEvent(string eventName, Dictionary<string, object> eventData)
{   
    if (!PlayFabClientAPI.IsClientLoggedIn()) return;
    
    var request = new WriteClientPlayerEventRequest
    {
        EventName = eventName,
        Body = eventData,
        Timestamp = DateTime.Now
    };

    PlayFabClientAPI.WritePlayerEvent(
        request,
        response =>
        {
            Debug.Log("EVENT SUCCESS");
        },
        error =>
        {
            Debug.Log($"EVENT ERROR {error.Error}, {error.ErrorMessage}, {error.ErrorDetails}");
        });
}

Such implementation of Player Events results in an error massage saying that there are invalid input parameters. Could anyone help with what should be changed or what is missing?

analytics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

Since in my test your coed works fine,you may test WritePlayerEvent API with Postman first to avoid coding issue.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.