Unity-Facebook WebGL Guide

This page will walk you through the steps on publishing your Unity WebGL game to Facebook Web. You will learn this over the following sections:

  1. Download Unity with Facebook Games
  2. Unity Installation
  3. Build WebGL target
  4. Upload WebGL package
  5. Configure App Settings
  6. Optimizing for Facebook.com

Download Unity with Facebook Games

Download and install the Unity with Facebook build support (available from 5.6 onwards):

Visit Unity Store to Download

Unity Installation

During Unity installation, make sure that you select the following components:

  • WebGL Build Support
  • Facebook Games Build Support

This installation screen might look slightly different depending on your operating system.

Build WebGL target

  • Launch Unity and open File > Build Settings.
  • Select Facebook as your platform, and click the Switch Platform button.
  • Choose WebGL under target platform.
  • Select 'Package build for uploading', and click Build.
  • Once your build is completed, there should be a 7z package in the build output directory. (e.g. webglbuild.7z)

Upload WebGL package

  • Navigate to your app dashboard in your browser. For example, https://developers.facebook.com/apps/{APP_ID}/hosting/
  • Under Web Hosting, select Unity (WebGL) from the dropdown menu.
  • Click Upload Version and Choose File to upload your 7z package.
  • Click Push to Production to set your 7z package to production.

Configure App Settings

Under App Review, make sure you have App Details (games only) submitted and approved. For example, under https://developers.facebook.com/apps/{APP_ID}/review-status/

Set your game to live and available to the public.

Make sure that you have added App Center as a product:

Upload your app icons and screenshots, and make sure that you are listed for App on Facebook:

Optimizing for Facebook.com

Now that you have published your WebGL game, it will be available on Facebook Web and selectively for Gameroom. You can learn more on how to optimize your game for Facebook.com here.