facebookunity-game-enginefacebook-instant-games

Facebook - How to remove loading screen from Instant Games


I am currently running into some trouble of trying to remove the loading screen from Facebook Instant Games.

I have tried following this Quick Start tutorial. Unfortunately, the loading screen still appears.

Screenshot of the problem

I am using the Unity game engine to create games. Any recommendations on how to remove it would be highly appreciated.


Solution

  • You need to be using the Instant Games API. For example:

    FBInstant.intializeAsync().then(() => {
      // load your game
      return FBInstant.startGameAsync();
    }).then(() => {
      // your game logic
    });
    

    You can't use this API directly from C# as it's a JavaScript API. To use JavaScript from Unity see this tutorial: https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html