Search code examples
facebook-unity-sdk

Unity + Facebook SDK: The name `FB' does not exist in the current context


I want to integrate the facebook sdk in my existing unity game, but receive the following error message when trying to initialize the sdk: "The name `FB' does not exist in the current context"

I followed the "Getting started" guide as well as the "Facebook SDK for Unity - Examples" part on the facebook developer page. Not sure what I'm missing and the docs aren't any help :/


Solution

  • Add the Facebook namespace to your scripts referencing FB:

    using Facebook.Unity;