Hi
I'm using ChangeUserDetailRequest to set player's language, but I cannot get it via could code API?
Please help.
Thanks
Jo
Hi Jo,
You could save the language to a players scriptData by setting the ChangeUserDetailsRequest Cloud Code to the following
var lang = Spark.getData().language; var setLanguage= Spark.getPlayer().setScriptData("language", lang); Spark.setScriptData("language", lang)
You could then retrieve it with
var language = Spark.getPlayer().getScriptData("language");
Let me know if this helps.
Thanks,
Liam
Can you clarify what steps you are trying and what is not working for you?Thanks,
Oisin.
Hi Oisin:
in iOS client:
NSString *langID = [[NSLocale preferredLanguages] objectAtIndex:0];
GSChangeUserDetailsRequest* r = [[GSChangeUserDetailsRequest alloc] init];
[r setLanguage:langID];
In NoSql explorer, I saw that the language value is stored in player Object.
But in cloud code, how to get the language set by Client?
Err...
Hi Ryan,
Thanks for spotting that typo, have corrected it !
Jo Huang
Hi
I'm using ChangeUserDetailRequest to set player's language, but I cannot get it via could code API?
Please help.
Thanks
Jo
Hi Jo,
You could save the language to a players scriptData by setting the ChangeUserDetailsRequest Cloud Code to the following
You could then retrieve it with
Let me know if this helps.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Jo,
Can you clarify what steps you are trying and what is not working for you?
Thanks,
Oisin.
Jo Huang
Hi Oisin:
in iOS client:
NSString *langID = [[NSLocale preferredLanguages] objectAtIndex:0];
GSChangeUserDetailsRequest* r = [[GSChangeUserDetailsRequest alloc] init];
[r setLanguage:langID];
In NoSql explorer, I saw that the language value is stored in player Object.
But in cloud code, how to get the language set by Client?
Thanks
Jo
Customer Support
Hi Jo,
You could save the language to a players scriptData by setting the ChangeUserDetailsRequest Cloud Code to the following
You could then retrieve it with
Let me know if this helps.
Thanks,
Liam
Ryan Fuller
Err...
var language = Spark.getPlayer().getScriptData("language");
Customer Support
Hi Ryan,
Thanks for spotting that typo, have corrected it !
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 2487 topics