2014-12-22 3 views
0

페이스 북 유니티 SDK를 사용하여 벽 게시가 페이스 북에 성공적으로 게시되었는지 확인하는 방법? 거기에 로그인, FB.isLoggedIn에 대한 것과 같은 어떤 조건 검사가 있습니까? 어떤 것이 성공적으로 게시되었을 때 어떤 행동을 취하는가?fb 벽 게시물 성공의 일치 확인

답변

0

콜백을 사용할 수 있습니다.

FB.Feed("", link, message, caption, linkName, linkToImage, "", "", "", "", null, OnActionShared); 

콜백에서는 게시물이 성공했는지 여부를 처리합니다.

public void OnActionShared(FBResult result){ 
      if(result.Error != null) 
      { 
       Debug.LogError("OnActionShared: Error: " + result.Error); 
      } 

      if (result == null || result.Error != null) 
      { 
       //Do something request failed 
      } 
      else 
      { 
       var responseObject = Json.Deserialize(result.Text) as Dictionary<string, object>; 
       object obj = 0; 
       if (responseObject == null || responseObject.Count <= 0 || responseObject.TryGetValue("cancelled", out obj)) 
       { 
        Debug.LogWarning("Request cancelled"); 
        //Do something when user cancelled 
       } 
       else if (responseObject.TryGetValue("id", out obj) || responseObject.TryGetValue("post_id", out obj)) 
       { 
        Debug.LogWarning("Request Send"); 

        //Do something it is succeeded 
       } 
      } 
     }