• 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

Does GetEligiblePromotions trigger Automated Promotions in real-time after XP level update?

Scheduled Pinned Locked Moved Unsolved APIs
3 Posts 2 Posters 9 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.
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by
    #1

    We have an Automated Promotion tied to a segment condition: experienceLevel >= 4.

    Our flow is:

    1. Server calls incrementExperiencePoints() via CloudCode → player reaches level 4
    2. Client immediately calls GetEligiblePromotions (client-side CAPI)
    3. The promotion is not returned

    However, if the player restarts the app and logs in again, GetEligiblePromotions does return the promotion correctly.

    Questions:

    1. Does GetEligiblePromotions evaluate segment conditions in real-time against current player state, or does it rely on a cached/pre-calculated segment membership?
    2. If there is a delay between incrementExperiencePoints and when the promotion becomes available via GetEligiblePromotions, how long is that delay typically?
    3. Is there a way to force immediate promotion triggering when a player's level changes mid-session?
    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote last edited by
    #2

    Hi, GetEligiblePromotions is snapshot-driven, not fully real-time. It relies on a cached promotion-eligibility snapshot stored on the UserProfile, which is only refreshed at specific points.

    • GetEligiblePromotions does not reevaluate Automated Promotion segment conditions (like experienceLevel >= 4) against the latest player state on every call. Instead, it uses the last calculated promotion snapshot that was written to the UserProfile. That snapshot is normally refreshed at login, or when you explicitly call the RefreshPromotions CAPI.

    • Because of that, the “delay” you are seeing is essentially “until the next snapshot refresh.” In your current flow, that refresh happens on the next login, which is why restarting the app makes the promotion suddenly appear. There is no fixed time-based delay; it is purely tied to when the snapshot is updated.

    • To make the promotion available immediately mid-session, add an explicit refresh step to your flow. After your CloudCode call to incrementExperiencePoints (once the player has reached level 4), call RefreshPromotions on the client, and then call GetEligiblePromotions. That will force an immediate refresh of the promotion snapshot so the level-4 promotion is returned without requiring a new session.

    API details for RefreshPromotions:
    https://docs.braincloudservers.com/api/capi/appstore/refreshpromotions.

    1 Reply Last reply
    0
  • G Offline
    G Offline
    gyutaelee
    wrote last edited by
    #3

    It's been resolved. Thank you for your response!

    1 Reply Last reply
    0

  • Login

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