2014-05-08 60 views
0

我正在製作Unity3d遊戲,並且在使用FB.Feed()時出現問題() 我閱讀了facebook的文檔,並看到: 「提示用戶發帖可以發佈到他/她自己的時間表(如果toId爲空,或者設置爲用戶自己的Facebook用戶ID),或者發佈到一個朋友的發件人(如果toID設置爲該朋友的用戶ID )「。如何在Unity3d中發佈消息給朋友的時間軸

public static void Feed(
    string toId = "", 
    string link = "", 
    string linkName = "", 
    string linkCaption = "", 
    string linkDescription = "", 
    string picture = "", 
    string mediaSource = "", 
    string actionName = "", 
    string actionLink = "", 
    string reference = "", 
    Dictionary<string,string[]> properties, 
    FacebookDelegate callback = null 
) 

以及如何使用此功能發送消息給我的任何朋友的牆?

回答

0

首先,你必須得到你的朋友ID。你可以使用

FB.API ("/me/friends/?fields=id", Facebook.HttpMethod.GET, callback); 
it returns list ID friends. 

然後,調用它打開對話框。

FB.Feed(
    toId:"YOUR FRIEND ID", 
    link: "https://example.com/myapp/?storyID=thelarch", 
    linkName: "The Larch", 
    linkCaption: "I thought up a witty tagline about larches", 
    linkDescription: "There are a lot of larch trees around here, aren't there?", 
    picture: "https://example.com/myapp/assets/1/larch.jpg", 
    callback: LogCallback 
); 

就是這樣。

相關問題