My WPF application i am using facebook C# SDK to upload videos to facebook wall. From last two days, when i upload video through my application, SDK returns "(OAuthException - #1) An unknown error has occurred." exception, but my video file uploaded to my facebook wall.
I tried the following way to resolve this problem,
1) Created new appliction for new AppID and AppSecretID.
2) Change authentication permissions (current permissions provided user_about_me,read_stream,publish_stream,user_photos)
3) Clear the existing application permission in my facebook account
4) Creating new facebook application and upload a video file.
But nothing helps me. Here is the code i used to upload video,
public Task<bool> FacebookPost(string message,Stream videoFileStream)
{
bool result = false;
try
{
if (!string.IsNullOrEmpty(_localSettings.FBAccessToken))
{
_fbClient.AccessToken = "ACCESS_TOKEN";
_fbClient.AppId = "APP_ID";
_fbClient.AppSecret = "APP_SECRET";
var media = new FacebookMediaStream { ContentType = "video/mp4", FileName = "TestVideo.mp4" }.SetValue(fbStream);
dynamic parameters = new ExpandoObject();
parameters.Title = "Sample Video";
parameters.description = message;
parameters.source = media;
var uploadResult = await _fbClient.PostTaskAsync("me/videos", parameters);
result = uploadResult != null;
}
}
catch (FacebookOAuthException ex)
{
result = false;
}
return result;
}
Any help it will would be appreciated. Thanks in advanced.