0
我正嘗試在silverlight中使用facebook sdk構建應用程序。facebook.stream.addlike無法在silverlight中工作
在我的應用程序需要發送「喜歡」一個職位,要達到這個現在用下面的異步調用:
_fb.Stream.AddLikeAsync(_dataAccess.Session.UserId, feed.stream_post.post_id, OnLikeCompleted, null);
這是給一個異常說
{Facebook的。 Utility.FacebookException:必須指定一個會話密鑰 ,當請求使用會話密鑰 在Facebook.Utility.Utilities.ParseException(字符串響應,布爾JSONFormat)上簽名時 at Facebook.Rest.RestBase.OnRequestCompleted(Obje CT發件人,RequestCompletedEventArgs E)}
private void lnkLike_Click(object sender, RoutedEventArgs e)
{
var feed = (sender as FrameworkElement).DataContext as StreamStory;
MessageBox.Show(feed.stream_post.post_id.ToString());
_fb.Stream.AddLikeAsync(_dataAccess.Session.UserId, feed.stream_post.post_id, OnLikeCompleted, null);
}
private void OnLikeCompleted(bool result, Object state, FacebookException e)
{
if (e == null)
{
Dispatcher.BeginInvoke(() => MessageBox.Show("likes success"));
var actual = result;
}
else
{
Dispatcher.BeginInvoke(() =>MessageBox.Show("Error: " +e.Message));
}
}
請幫我解決上述問題。提前致謝。