I am trying to allow the user to share the final game score on their FaceBook timeline. I am following FaceBook tutorial and examples. When I try to download and import the FaceBook SDK package (7.11-2.0) in Unity (2017.3) I get the error:
error CD1704: An assembly with the same name 'FaceBook.Unity.Settings' has already been imported. Consider removing one of the references or sign the assembly Library/FacebookSDK/FaceBook.Unity.Settings.dll (Location of the symbol related to previous error)
I read on other posts that the latest version of Unity may have the Facebook SDK already integrated, and will not require importing the package manually.
I therefore removed the from my project. The error disappear, but when I try to initialize the Facebook SDK for Unity using the code below, I get the error:
The name `FB' does not exist in the current context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Facebook.Unity;
public class ShareOnFaceBook : MonoBehaviour {
// Use this for initialization
void Awake () {
if (!FB.IsInitialized) {
// Initialize the Facebook SDK
FB.Init(InitCallback, OnHideUnity);
} else {
// Already initialized, signal an app activation App Event
FB.ActivateApp();
}
}