To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.
var request = new SparkRequests.AccountDetailsRequest();
var response = request.SendAs(playerID); //playerID = the id of the player you want the details for.
Spark.setScriptData("Location", response.location)
Thanks,
Liam
1 Comment
Customer Support
said
over 4 years ago
Answer
Hi Ahsan,
To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.
var request = new SparkRequests.AccountDetailsRequest();
var response = request.SendAs(playerID); //playerID = the id of the player you want the details for.
Spark.setScriptData("Location", response.location)
ahsan muzaheed
how to get access to location data of other participants's in a match ?
looking for this part of data:
"location":{"country":"BD","latitide":23.699996948242188,"city":null,"longditute":90.375},
Hi Ahsan,
To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.
Thanks,
Liam
Customer Support
Hi Ahsan,
To get another players location details you'd have to send a request as them in Cloud Code using a SparkRequest. You can do that with the following.
Thanks,
Liam
-
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