Now I'm really confused with LogEventReQuest because in your tutorial "using cloud code" we can define some event with Attribute. But now, GameSparks update to portal 2 and its removed. So my question, how can i use it in client (unity) and using cloud code do some calculate with this Attribute and response to client. Or how can i define it and useable? Here is Client: new LogEventRequest ().SetEventKey ("first event").SetEventAttribute ("number", "0.1f").SetEventAttribute ("number1", "1.1f").Send ((response) => {
if (response.HasErrors){
Debug.LogWarning(response.Errors.JSON);
}
else {
Debug.LogWarning(response.ScriptData.JSON);
}
});
and i want this in cloud code: var number = Spark.getdata().number; //maybe this
var number1 = Spark.getdata().number1; // maybe this too
Thank you
Best Answer
H
Hu~u Ða?o
said
almost 4 years ago
Oh, Hi Liam, I'm here to sorry you.
I didnt see the Event Area because at first setting, i was off that feature, and i couldn't find it. Now i see it already.
For this to work you would need to make sure that you have the attributes defined in your event on the portal. In your case you would need to have the shortCodes configured as "number" and "number1" in the event called "firstEvent". You'd then need to supply the correct type from Unity (number,string, json). Once set up correctly you will be able to retrieve them in Cloud Code with the example you used at the bottom. You can find the updated version of this guide here.
Regards,
Liam
H
Hu~u Ða?o
said
almost 4 years ago
Thanks Liam for quick reply
But could you show me how to define the event with attribute in portal 2? Now its removed, or i can't find where is it or simple how to do it? Could you guide me step by step? Or Am I missing something about this?
Here is from your Portal 2 Overview: LogEventRequests and LogChallengeEventRequests:
Toggle Allhas been removed and that function is now carried by the main Request toggling all the secondary requests.
H
Hu~u Ða?o
said
almost 4 years ago
Answer
Oh, Hi Liam, I'm here to sorry you.
I didnt see the Event Area because at first setting, i was off that feature, and i couldn't find it. Now i see it already.
Thank you
1 person likes this
Customer Support
said
almost 4 years ago
Hi,
No problem, I'm glad to hear you found a solution for this. If you need anything else just let us know.
Regards,
Liam
H
Huda Rasmey
said
about 3 years ago
GSRequestData jsonDataToSend = new GSRequestData();
jsonDataToSend.AddString("param1", "xxx");
jsonDataToSend.AddString("param2", "yy");
logEventRequest = new LogEventRequest().SetEventKey("eventname").SetEventAttribute("attributeNname", jsonDataToSend);
Hu~u Ða?o
Hi community, I'm new in GameSparks.
Now I'm really confused with LogEventReQuest because in your tutorial "using cloud code" we can define some event with Attribute.
But now, GameSparks update to portal 2 and its removed.
So my question, how can i use it in client (unity) and using cloud code do some calculate with this Attribute and response to client. Or how can i define it and useable?
Here is Client:
new LogEventRequest ().SetEventKey ("first event").SetEventAttribute ("number", "0.1f").SetEventAttribute ("number1", "1.1f").Send ((response) => {
if (response.HasErrors){
Debug.LogWarning(response.Errors.JSON);
}
else {
Debug.LogWarning(response.ScriptData.JSON);
}
});
and i want this in cloud code:
var number = Spark.getdata().number; //maybe this
var number1 = Spark.getdata().number1; // maybe this too
Thank you
Oh, Hi Liam, I'm here to sorry you.
I didnt see the Event Area because at first setting, i was off that feature, and i couldn't find it. Now i see it already.
Thank you
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi,
For this to work you would need to make sure that you have the attributes defined in your event on the portal. In your case you would need to have the shortCodes configured as "number" and "number1" in the event called "firstEvent". You'd then need to supply the correct type from Unity (number,string, json). Once set up correctly you will be able to retrieve them in Cloud Code with the example you used at the bottom. You can find the updated version of this guide here.
Regards,
Liam
Hu~u Ða?o
Thanks Liam for quick reply
But could you show me how to define the event with attribute in portal 2? Now its removed, or i can't find where is it or simple how to do it? Could you guide me step by step? Or Am I missing something about this?
Here is from your Portal 2 Overview:
LogEventRequests and LogChallengeEventRequests:
Toggle All has been removed and that function is now carried by the main Request toggling all the secondary requests.
Hu~u Ða?o
Oh, Hi Liam, I'm here to sorry you.
I didnt see the Event Area because at first setting, i was off that feature, and i couldn't find it. Now i see it already.
Thank you
1 person likes this
Customer Support
Hi,
No problem, I'm glad to hear you found a solution for this. If you need anything else just let us know.
Regards,
Liam
Huda Rasmey
GSRequestData jsonDataToSend = new GSRequestData();
jsonDataToSend.AddString("param1", "xxx");
jsonDataToSend.AddString("param2", "yy");
logEventRequest = new LogEventRequest().SetEventKey("eventname").SetEventAttribute("attributeNname", jsonDataToSend);
-
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 2486 topics