Jump to content

Which message will updateAsync() send?


pingu
 Share

Recommended Posts

Hi,

When my player is playing against someone else (in a "context"), I make sure I send out updateAsync() updates with each score the player makes. I send updates for even non-high scores, because high scores aren't commonplace. From the API side, I wish that the single update that got sent out was of the highest score in that session. For example, if my player scores 4, 2, 14 and 5 in a session and I call updateAsync with each of those scores, I would have wished that it sent the score 14. But in practice I find that the score sent is either the first one (4) or non-deterministic. Any advice here?

Thank you

Link to comment
Share on other sites

Hi @pingu, might want to check the documentation for "strategy":

  • strategy string? Specifies how the update should be delivered. This can be one of the following: 'IMMEDIATE' - The update should be posted immediately. 'LAST' - The update should be posted when the game session ends. The most recent update sent using the 'LAST' strategy will be the one sent. 'IMMEDIATE_CLEAR' - The update is posted immediately, and clears any other pending updates (such as those sent with the 'LAST' strategy). If no strategy is specified, we default to 'IMMEDIATE'.

Source: https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...