我有一个发布到Facebook的wp8应用程序。我进行了一次救援以防止两次发布相同消息的错误。我想让我的应用程序只是通知用户并继续前进,但我似乎无法解决此错误。
fb.PostCompleted += (o, args) =>
{
if (args.Error != null)
{
Dispatcher.BeginInvoke(() =>MessageBox.Show(args.Error.Message));
return;
}
var result = (IDictionary<string, object>)args.GetResultData();
_lastMessageId = (string)result["id"];
Dispatcher.BeginInvoke(() =>
{
MessageBox.Show("Message Posted successfully");
});
};
var parameters = new Dictionary<string, object>();
parameters["message"] = "hi";
var message = "Any Status message";
fb.PostTaskAsync("me/feed", parameters);
答案 0 :(得分:0)
你能不能忽略这个错误?
fb.PostCompleted += (o, args) =>
{
if (args.Error != null)
{
return;
}
else
{
var result = (IDictionary<string, object>)args.GetResultData();
_lastMessageId = (string)result["id"];
Dispatcher.BeginInvoke(() =>
{
MessageBox.Show("Message Posted successfully");
});
}
};
var parameters = new Dictionary<string, object>();
parameters["message"] = "hi";
var message = "Any Status message";
fb.PostTaskAsync("me/feed", parameters);
您还可以深入了解args.Error
以查看给出的错误消息类型。这样,您可以决定在重复发布错误时不显示任何内容