Hi.
Why the callback in FB.Feed is not being called? is it normal? Im using last facebook sdk version.
Thank you.
public class Feed : MonoBehaviour
{
#region FB.Init() example
private bool isInit = false;
private void CallFBInit()
{
FB.Init(OnInitComplete, OnHideUnity);
}
private void OnInitComplete()
{
Debug.Log("FB.Init completed");
isInit = true;
CallGetAuthResponse();
}
private void OnHideUnity(bool isGameShown)
{
Debug.Log("Is game showing? " + isGameShown);
}
#endregion
#region FB.Login() example
private void CallFBLogin()
{
FB.Login("email,publish_actions,user_about_me", Callback);
}
#endregion
#region FB.GetAuthResponse() example
private void CallGetAuthResponse()
{
FB.GetAuthResponse(Callback);
}
#endregion
#region FB.Feed() example
public string FeedToId = "";
public string FeedLink = "";
public string FeedLinkName = "";
public string FeedLinkCaption = "";
public string FeedLinkDescription = "";
public string FeedPicture = "";
public string FeedMediaSource = "";
public string FeedActionName = "";
public string FeedActionLink = "";
public string FeedReference = "";
public bool IncludeFeedProperties = false;
private Dictionary FeedProperties = new Dictionary();
private void CallFBFeed()
{
Dictionary feedProperties = null;
if (IncludeFeedProperties)
{
feedProperties = FeedProperties;
}
FB.Feed(
toId: FeedToId,
link: FeedLink,
linkName: FeedLinkName,
linkCaption: FeedLinkCaption,
linkDescription: FeedLinkDescription,
picture: FeedPicture,
mediaSource: FeedMediaSource,
actionName: FeedActionName,
actionLink: FeedActionLink,
reference: FeedReference,
properties: feedProperties,
callback: delegate(FBResult result) { consoleLog = "feeed calleed"; }
);
}
#endregion
private string consoleLog;
void OnGUI()
{
GUI.Label(new Rect(0,0,Screen.width,70), consoleLog);
if(GUI.Button (new Rect(0,Screen.height-100,100,100), "Init"))
{
CallFBInit();
}
if(GUI.Button (new Rect(100,Screen.height-100,100,100), "Login"))
{
CallFBLogin();
}
if(GUI.Button (new Rect(200,Screen.height-100,100,100), "Feed"))
{
CallFBFeed();
}
}
void Callback(FBResult result)
{
consoleLog = result.Text;
}
}
↧