Getting client app version
Solved
Cloud Code
-
Hmm, interesting question - I don't believe that value is currently made available - though I could definitely see it being useful for scripts. I'll discuss with the devs.
In the meantime, you can get this info by creating a post-hook for the Authenticate call.
The script that you hook into the call will receive the appVersion (field "gameVersion" internally) as a STRING in a "data.callingMessage.gameVersion" field.
I've attached a sample script that stores the gameVersion to the session cache (and writes a log message stating the gameVersion received).
To try it:
- Import the script
- Go to Design | Cloud Code | API Hooks and configure the hook as a POST hook for the Authenticate service, Authenticate Operation
- Go to the API Explorer and do a test login. Be sure to set the "appVersion" in the JSON (by default it is "").
- Info Messages, hit [Refresh] to see the log with your app version.
Hope that helps!
Paul.