pingu Posted August 6, 2018 Share Posted August 6, 2018 Hello Here is how I plan to implement my game: 1. game starts (from somewhere, either by search on Messenger or a friend inviting on Messenger, or a group share) 2. Player plays one round and dies 3. Player is shown a dialog to invite his friends (through FBInstant.chooseAsync()) 4. Player chooses one of her friends and comes back to the game. Q: Does her friend immediately receive an invite? 5. Player makes a high score. I call "FBInstant.updateAsync()" with her high score and some text and image (RICH_GAMEPLAY update). Q: Who does this message go to? I can't choose any recipient when I send this, so who does it send it to? Q: What is the difference between "shareAsync" and "updateAsync"? Q: Does it matter where the player started playing the game from? Whether it was from a friend's invite or from a Facebook post share? Which steps above would it affect? Thank you Quote Link to comment Share on other sites More sharing options...
Noel Posted August 7, 2018 Share Posted August 7, 2018 Hi, 4. Yes, it is sent immediately 5. It is sent to the current context (could be a 1:1 conversation or a group conversation) 6. It is well documented: https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2, https://developers.facebook.com/docs/games/instant-games/rich-gameplay-features and https://developers.facebook.com/docs/games/instant-games/best-practices. I do not think I can put better words on it than the documentation itself. 7. Not really. But when you enter from a custom update for example, as it contains data (getEntryPointData), you can resume a game where it was and other things. I hope that helped. Quote Link to comment Share on other sites More sharing options...
pingu Posted August 7, 2018 Author Share Posted August 7, 2018 Hi @Noel Thanks for the reply. Let me write down my findings so it can help others. shareAsync() is used to share an image / text to a new context (the user gets to choose). updateAsync() will always share to the current context (without the user getting to choose). This means that if the game doesn't have a context (maybe because chooseAsync() was never called in the first place) it won't do anything. Quote 4. Yes, it is sent immediately This is not quite correct I think. chooseAsync() only sets the context. Only after calling updateAsync() will the actual messages get sent. Correct me if I'm wrong. Another question I have is, how do I debug FBInstant code? For example, for me, updateAsync() is simply not sending any message even after I make thep player choose the context. How do I debug this? I created the custom template, I put the correct object with base64 image, template reference, text, etc. but it just won't send the message Thanks Quote Link to comment Share on other sites More sharing options...
pingu Posted August 8, 2018 Author Share Posted August 8, 2018 To answer my own question, it is possible to debug FB instant games on the desktop browser using browser developer tools and console.log Quote Link to comment Share on other sites More sharing options...
Noel Posted August 13, 2018 Share Posted August 13, 2018 Hi @pingu, it looks like you do not need me anymore Let me know if you have other questions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.