How do I create a Facebook Share button? [Unity]

To get started with using Facebook in Gamedonia and initialize the Facebook plugin/SDK, visit our Facebook integration guide.

As with any other Facebook call, first we will need to have the user logged in Facebook. To do that, you can take a look at our Facebook login tutorial or our "Simple Login" Sample, where you can see a Facebook login button working. You can also follow the steps described in the Gamedonia Facebook guide.

Once the user is logged in, we need to call the Dialog method with the "feed" type as done in this example of our Facebook guide:

void ShareFacebookClick() {
 
    IDictionary parameters = new Dictionary<string,object> ();
    parameters.Add ("app_id","<your-facebook-app-id>");
    parameters.Add ("from", "<currently-logged-in-fbuid>");
    parameters.Add ("link", "<link-to-the-shared-content>");
    FacebookBinding.Dialog ("feed", parameters, true, OnShare);
 
}
...
private void OnShare(IDictionary data) {
    //TODO probably u don't need to do anything here but maybe i'm wrong ;)
}

More info here: Facebook integration guide