- Home /
FB Integration
I'm currently equipping my share score script with proper Facebook integration. I've been following a tutorial online exactly, but I am never prompted to login or share a post. My button is set to run the Share() function.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Facebook.Unity;
public class ask4LOGIN : MonoBehaviour {
private const string FACEBOOK_APP_ID = "118943272041914";
private const string FACEBOOK_URL = "http://www.facebook.com/dialog/feed";
private int roll;
private string sent;
public int finalScore;
void Awake ()
{
if (!FB.IsInitialized) {
FB.Init();
} else {
FB.ActivateApp();
}
}
public void Login() {
FB.LogInWithReadPermissions();
}
public void Share () {
Login();
FB.ShareLink(
contentURL: new System.Uri("https://www.facebook.com/feed"),
contentTitle: "beCAREFUL",
contentDescription: "I thought up a witty tagline about larches"
//picture: new System.Uri("http://www.cashjohnson.net/ico.png")
//callback: FeedCallback
);
}
}
Comment
Your answer
Follow this Question
Related Questions
Facebook Login Invalid App Id : 0 2 Answers
How to get FB SDK accesToken for page ? 0 Answers
GooglePlayGames + FacebookSDK 0 Answers
FaceBook SDK 0 Answers
Facebook SDK login problem on Android 0 Answers