1

I'm trying to use the Unity Facebook SDK to do simple feed posts and I'm having issues.

I appear to log in/log out just fine. But when I try to post a feed message it doesn't go through.

public void TestPost()
{
    FB.Feed(link: "http://www.vidasystems.com/",
    linkName: "Bone Genius",
    linkCaption: "I got a score of ABC on Bone Genius!",
    linkDescription: "There are a lot of bones in this game!",
    callback: LogCallback);
}
void LogCallback(FBResult response) {
    Debug.Log("FAcebook response text is: '" + response.Text + "' error: '" +
         response.Error + "' tostring: '" + response.ToString()+ "'.");
}

In the Unity Editor I get the following in console:

400 Bad Request
UnityEngine.Debug:LogError(Object)
FbDebug:Error(String)
Facebook.FallbackData:JSFallback(String)
Facebook.AsyncRequestDialogPost:CallbackWithErrorHandling(FBResult)
Facebook.<Start>c__Iterator0:MoveNext()

External Call: fbUi("{\"link\":\"http://www.vidasystems.com/\",
    \"name\":\"Bone Genius\",
    \"caption\":\"I got a score of ABC on Bone Genius!\",
    \"description\":\"There are a lot of bones in this game!\",
    \"app_id\":\"Redacted\",
    \"locale\":\"en_US\",
    \"method\":\"feed\"}",
     "1");
UnityEngine.Application:ExternalCall(String, Object[])
Facebook.CanvasFacebook:JSFallbackUI(String, Dictionary`2, FacebookDelegate)
Facebook.FallbackData:JSFallback(String)
Facebook.AsyncRequestDialogPost:CallbackWithErrorHandling(FBResult)
Facebook.<Start>c__Iterator0:MoveNext()

My call back function is never called.

On iOS I get:

FBSDKLog: FBShareDialogParams: 
    only "http" or "https" schemes are supported for link thumbnails
-> applicationWillResignActive()
-> applicationDidEnterBackground()
-> applicationWillEnterForeground()
-> applicationDidBecomeActive()
id:1 msg:

The iOS call back function gets nothing in return:

Facebook response text is: '' error: '' tostring: 'FBResult'.

Update: I added a 'picture' field and that made the iOS error go away. However I still don't have anything showing on my facebook wall.

Avatara359
  • 21
  • 1
  • 4
  • app_id should the numeric id and not a string – WizKid May 15 '14 at 23:14
  • I removed the app_id from the post for security reasons. – Avatara359 May 15 '14 at 23:28
  • Okay. So the 400 bad request seems to be from using the Unity Editor for trying to post, even with a graph token. I managed to get posts working by adding a a 'picture' field to my post as well as following the instructions at: http://stackoverflow.com/questions/21022557/unity-fb-sdk-on-ios-problems-with-fb-feed-function Apparently it still isn't fixed: > open FbUnityInterface.mm and go to line 46. You should see the code > > `self.dialogMode = NativeDialogModes::FAST_APP_SWITCH_SHARE_DIALOG;` > > change that to > > `self.dialogMode = NativeDialogModes::WEBVIEW_DIALOG_MODE;` – Avatara359 May 15 '14 at 23:52

0 Answers0