• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Getting client app version

Scheduled Pinned Locked Moved Solved Cloud Code
client app versiongameversion
3 Posts 2 Posters 341 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    madalin
    wrote on last edited by Paul Winterhalder
    #1

    Hi!
    How can we get the client app version (sometimes referred to as the gameVersion) into a BrainCloud script (for the current session)?

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #2

    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.

    LogIncomingAppVersion.ccjs

    1 Reply Last reply
    1
  • M Offline
    M Offline
    madalin
    wrote on last edited by
    #3

    Thank you for your answer. Yes, it will be nice to have a separate API but for now, the solution suggested by you works for us.

    1 Reply Last reply
    1

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users