- Home /
Facebook sdk FB.Feed Don't execute the Callback.
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<string, string[]> FeedProperties = new Dictionary<string, string[]>();
private void CallFBFeed()
{
Dictionary<string, string[]> 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;
}
}
Have exactly the same problem on Android build. Any ideas?
I have almost the same problem. Plateform iOS. The callback is working but the result always return "cancelled".
the same problem on iOS. result always: {"cancelled":true}
I'm using FB SD$$anonymous$$ 4.3.6 with an Android system, and I'm not getting the callback. From LogCat I see the following:
D/FacebookSD$$anonymous$$.WebDialog(18781): Webview loading URL: https://m.facebook.com/dialog/feed D/FacebookSD$$anonymous$$.WebDialog(18781): Redirect URL: fbconnect://success?post_id=100004516925128_243538025806760 V/FBUnitySD$$anonymous$$(18781): sending to Unity OnFeedRequestComplete({"id":"100004516925128_243538025806760"})
However, my callback function is never actually called.
Answer by kanpot2002 · Feb 18, 2014 at 04:08 PM
I found the same problem and think this should help you
Your answer
Follow this Question
Related Questions
Unity Web Player WWW Call 0 Answers
Will Facebook Gameroom SDK work with mobile as well? 0 Answers
Getting multiple photos at once but in the correct order with Facebook SDK 1 Answer
Unity: Is there any alternative to facebook SDK for facebook ads attribution? 0 Answers
Facebook SDK(android) - error 1 Answer