2015-09-26 29 views
0

我與Facebook分享遊戲工作,但我不斷收到此錯誤:無重載方法'FeedShare」需要'6' 參數的Facebook SDK V7.1.0團結

沒有重載方法FeedShare' takes 6的論點

這裏是我的代碼

using UnityEngine; 
using System.Collections; 
using System.Collections.Generic; 
using Facebook.Unity; 

public class FBHolder : MonoBehaviour { 

void Awake() 
{ 
     FB.Init (SetInit, OnHideUnity); 

} 

private void SetInit() 
{ 
    Debug.Log ("Facebook Init done"); 

    if (FB.IsLoggedIn) { 
     Debug.Log ("Facebook logged in"); 
    } else { 
     FBLogin(); 
    } 
} 

private void OnHideUnity (bool isGameShown) 
{ 
    if (!isGameShown) { 
     Time.timeScale = 0; 
    } else { 
     Time.timeScale = 1; 
    } 
} 

void FBLogin() 
{ 
    var perms = new List<string>(){"public_profile", "email", "user_friends"}; 
    FB.LogInWithReadPermissions (perms, AuthCallback); 
} 

private void AuthCallback (ILoginResult result) { 
    if (FB.IsLoggedIn) { 
     Debug.Log("FB Login Worked"); 
     // share facebook 
     FB.FeedShare(
      link: "https://enterlinkhere.com", 
      linkName: "PollyCube", 
      linkCaption: "LinkCaption", 
      linkDescription: "LinkDescription", 
      picture: "https://enterimagehere.com", 
      callback: LogCallback 
      ); 

    } 
    else { 
     Debug.Log("User cancelled login"); 
    } 
} 



void LogCallback(IResult response) { 
    Debug.Log("Worked"); 
} 


} 

,這是爲Facebook Feedshare(也是我的代碼張貼以上)的代碼

  FB.FeedShare(
      link: "https://enterlinkhere.com", 
      linkName: "PollyCube", 
      linkCaption: "LinkCaption", 
      linkDescription: "LinkDescription", 
      picture: "https://enterimagehere.com", 
      callback: LogCallback 
      ); 

    void LogCallback(IResult response) { 
    Debug.Log("Worked"); 
} 

我使用這個文檔的情況下,使這個你想知道在那裏我得到這個從

https://developers.facebook.com/docs/unity/reference/current/FB.FeedShare

回答

1

試試這個:

FB.FeedShare(
     string.Empty, //toId 
     new System.Uri("https://enterlinkhere.com"), //link 
     "PollyCube", //linkName 
     "LinkCaption", //linkCaption 
     "LinkDescription", //linkDescription 
     new System.Uri("https://enterimagehere.com"), //picture 
     string.Empty, //mediaSource 
     LogCallback //callback 
     ); 
1

你缺少的toID字段 - 即使他們說「您不需要指定toID以發佈到當前用戶的時間軸 - 只需將其保留爲空即可。 「,這並不意味着你不能把參數!

嘗試把」「或string.Empty代替...

相關問題