I want to trigger an event that i made in gs portal from c# unity script but its giving me this error :The best overloaded method match for `GameSparks.Api.Requests.LogEventRequest.LogEventRequest(GameSparks.Core.GSInstance)' has some invalid arguments
Here is my code snippet:
GSRequestData parameters = new GSRequestData().AddString("CC_ATTR","saad").AddNumber("CC_ATTR_2",1).AddJSONStringAsObject("CC_ATTR_3","name:saad"); new LogEventRequest("CC_EVT").SetScriptData(parameters).Send ((response) => { Debug.Log(response.JSONString); Debug.Log("ABOVE ME");
});
In other questions people are using GamesparksSend to trigger events but its obselete now im not sure its not recognizing it even though i have all the imports.
Best Answer
D
David Brandes
said
almost 7 years ago
GSRequestData parameters = new GSRequestData().AddString("CC_ATTR","saad").AddNumber("CC_ATTR_2",1).AddJSONStringAsObject("CC_ATTR_3","name:saad");
new LogEventRequest().SetEventKey("CC_EVT").SetScriptData(parameters).Send ((response) => {
Debug.Log(response.JSONString);
Debug.Log("ABOVE ME");
});
You cannot set the event key in the constructor of LogEventRequest. Use SetEventKey().
1 Comment
D
David Brandes
said
almost 7 years ago
Answer
GSRequestData parameters = new GSRequestData().AddString("CC_ATTR","saad").AddNumber("CC_ATTR_2",1).AddJSONStringAsObject("CC_ATTR_3","name:saad");
new LogEventRequest().SetEventKey("CC_EVT").SetScriptData(parameters).Send ((response) => {
Debug.Log(response.JSONString);
Debug.Log("ABOVE ME");
});
You cannot set the event key in the constructor of LogEventRequest. Use SetEventKey().
saad khan
I want to trigger an event that i made in gs portal from c# unity script but its giving me this error :The best overloaded method match for `GameSparks.Api.Requests.LogEventRequest.LogEventRequest(GameSparks.Core.GSInstance)' has some invalid arguments
Here is my code snippet:
GSRequestData parameters = new GSRequestData().AddString("CC_ATTR","saad").AddNumber("CC_ATTR_2",1).AddJSONStringAsObject("CC_ATTR_3","name:saad");
new LogEventRequest("CC_EVT").SetScriptData(parameters).Send ((response) => {
Debug.Log(response.JSONString);
Debug.Log("ABOVE ME");
});
In other questions people are using GamesparksSend to trigger events but its obselete now im not sure its not recognizing it even though i have all the imports.
You cannot set the event key in the constructor of LogEventRequest. Use SetEventKey().
David Brandes
You cannot set the event key in the constructor of LogEventRequest. Use SetEventKey().
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics