WebGl build and Facebook game platform - game does not load or work

Hi all,

Im trying to publish my game into facebook game platform without any integration with facebook service.
But im getting that issue when the game is not loading or\and the fb load animation is not going away.

Already upload game to another platform and having issue with fb only: Snake 'n' Cubes by kyxap

What I did:

  1. Added facebook sdk to the project and set app id in it
  2. Build the game
  3. Added fbapp-config.json
  4. Added this to the index.html
    <script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '<app-id>',
      xfbml      : true,
      version    : 'v12.0'
    });
    FB.AppEvents.logPageView();
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
    <script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>

Also I’ve tried:

  1. Enabling disabling Dev build
  2. Changing compressing from gzip to disable
    Nothing have effect on the problem

What I can’t understand:

  1. How I can send status of the game loader to the fb sdk to make it run? (that based on they docs: Quick Start - Facebook Games - Documentation - Meta for Developers)
  2. If fb does know about game status (loaded or still loading) why game is not loading and just stuck with 0%?

Any help will be appreciated!

some updates:

  1. I’ve removed facebook sdk since I don’t actually use it
  2. To ny index html i’ve adde only
  <script>

    window.onload = function () {
        FBInstant.initializeAsync().then(function () {
            FBInstant.setLoadingProgress(100);
        });
        FBInstant.startGameAsync().then(function () {
            startGame();
        })
    };
</script>
  <script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>

Dev console errors:

```
[UnityCache] indexedDB database could not be opened
Failed to load resource: the server responded with a status of 404 ()
[UnityCache] 'https://apps-1.apps.fbsbx.com/instant-bundle/1/1/Build/fb_new_try.data.gz' request failed with status: 404
```

And now im getting this:

Might sound like a stupid question but didn’t see it in your original post.

I assume the build loads properly on non-FB servers (locally)? From your 2nd post, it just seems like it can’t find the data.gz. I am not familiar with FB but are you sure GB supports .gz files and doesn’t strip them from the upload?

Thanks for the answer

I’ve uploaded game to another platform and having issue with fb only: https://kyxap.itch.io/snake-n-cubes

Actually seems like fb engine is repacking my original file to gz or something. Because I’ve used zip and only zip supported AFIK for app uploads. And I dont have any .gz inside of my zip