Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • 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
  1. Home
  2. Cloud Code
  3. Getting client app version

Getting client app version

Scheduled Pinned Locked Moved Solved Cloud Code
client app versiongameversion
3 Posts 2 Posters 1.6k Views 2 Watching
  • 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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

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