Jump to content

Can we make multiplayer games for FB Instant Games?

Recommended Posts


I was thinking that it would be nice to have multiplayer (coop and/or competitive) games on FB Instant Games as it is likely that you are at least two persons when you are having a conversation through FB Messenger!

The main issue I am facing is that I don't find any information on Facebook website to tell me if it is possible to have mutiplayer games on FB Instant Games. Could you give me more information about this?

Thank you very much.

Link to post
Share on other sites
  • 2 weeks later...

Thank you!

I did find some multiplayer games on FB instant game, but they all seems to be slow paced puzzle/word games as opposed to fast paced action games. Any reason for that?

I will try to use the link you give me, and try to find some tutorials. If there are no tutorials I may end up making one :)

Link to post
Share on other sites

I started to go through the official "getting started" tutorial where you're going to push a tic-tac-toe game including multiplayer and messenger bot on the Instant Game servers.

Here the page: https://developers.facebook.com/docs/games/instant-games/getting-started/game-setup

Here the tic-tac-toe project: https://origincache.facebook.com/developers/resources/?id=tic-tac-toe.zip

Following the tuto and README.md, I created the App Page, put the server-side (i.e. the bot) on Heroku, tested it with cURL and attached the Bot to the App Page, as it can be seen in the attached screenshot.

Now the server-side README.md tells me to run the following command in the server project:

node index 

This runs the bot on a local server, so I am not sure why I needed to do the above steps that set up my bot online... But anyway, now, when I run the client project with:

yarn test

I get an error:

Error loading from backend invalid signature


I am not sure what is going wrong here ... but it seems to come from the line `this.displayError(error);` in the file `game.js`. Here an extract, if that can help:

function gameplayScene(FBInstant, backendClient, html2canvas) {
    this._cells = [[],[],[]];
    this._matchData = {};
    this.SPRITES = ['love', 'like'];
    this.start = function() {
        var contextId = FBInstant.context.getID();
            return backendClient.load(signedPlayerInfo.getSignature());
            if (result.empty) {
                return this.createNewGameAsync();
            } else {
                return Promise.resolve(result.data);


I have few ideas / paths of investigations:

  • 1) when I invite a friend for a tic-tac-toe game, maybe this friend needs to be registered as a tester for my app, meaning they have to accept the invitation as a tester (which they didn't yet)
  • 2) the bot seems to need the pages_messaging permission to work properly, which I don't have (need to write a Privacy Policy etc..., that is  a bit involved for completing a getting started tuto ) 
  • 3) one thing that puzzles me is how the client knows whether to use the local bot on localhost:5000 or the online bot linked to the App Page...
  • EDIT: 4) Postgresql is not well configured

Any suggestion is welcome :) !


concerning 1) I registered my girlfriend, and yes indeed, you need your tester to accept the invite for the game to start in their messenger. However again, I've got a Invalid Signature error.

concerning 3), this is controlled by the line `const BACKEND_URL = 'http://localhost:5000';` in `index.html`.

concerning 4), now that I am connecting to my game server on localhost:5000, I don't have the invalid signature issue any more. However, from then, the problem was that my game server would not connect correctly to the Postgresql server and the table 'matches' requested by the game server did not exist in the Postgresql database anyway.

Hence I found out how to connect to the Postgresql server. In the file .env, set the DATABASE_URL like so, replacing  'username', 'password' and 'database_name' with the relevant information:


Note 1: your username is probably postgres, and if you follow the below instructions, the database_name will also be postgres. The password is the one you were asked when installing postgresql.

Note 2: localhost:5432 is the default local server, use a service such as heroku (https://www.heroku.com/postgres) to set up an online server, the DATABASE_URL will be available in the setting page of the postgres server.

Then open 'pgAdmin4', unfold the graph tree until you see "Tables", right-click on it, Create>Table..., name it 'matches', then unfold the tree to see 'Columns', right-click on it and Create>Column, name it "context", select type "text". Now create a column "data" the same way.




Edited by Nodragem
I progressed a little bit in my issue resolving :)
Link to post
Share on other sites

So, after some effort, I (the admin player) run successfully the client-side of the tic-tac-toe game in localhost with SSL, while running the server-side in localhost, and communicating with an online postgresql server.

When doing so, the player I selected (i.e. a tester who accepted to be a tester) can open the game on their phone/messenger, but obviously they cannot play because the server-side is running on my PC in localhost. Interestingly, the tester's console prints the error "Error loading from backend invalid signature".

Now, when I run the server-side on heroku, I get the error "Error loading from backend invalid signature" on my client-side (admin player). So basically, I am back to the same issue as before, but with the assurance that the game does run correctly when the server-side is running on localhost. Hence, there probably a problem with my connection to heroku server...

I will update this post if I solve this last bit.


EDIT: I succeeded to get everything up and running! turns out that I was not using the right URL to my heroku backend ! As simple as that ^^

Edited by Nodragem
Solved my issue!
Link to post
Share on other sites
  • 1 year later...
  • 1 month later...

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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...