c# - FacebookClient GetTaskAsync sometimes returns invalid JSON string(UWP 10) -
i'm trying data facebook using facebookclient api. error "invalid json string". strange thing data using same task.
this code
public async void getdata(string accesstoken, string task) { facebookclient fbclient = new facebookclient(accesstoken); try { var res = await fbclient.gettaskasync(task);//me/feed string data = res.tostring(); /*idictionary<string, object> o3 = (idictionary<string, object>)await fbclient.gettaskasync(task); jsonobject o2 = (jsonobject) await fbclient.gettaskasync(task);*/ } catch (exception e) { } }
var res = ... gives error. don't know why works , time doesn't.
thanks in advance.
the sdk stopped working in windows 10 apps (uwp), continues work fine in windows 8.1 apps.
it's been reported on github page of facebook-csharp-sdk. cause uwp's default newer http/2 protocol causing problems. unfortunately, there no fix yet.
update: there temporary solution if open internet explorer > internet options > advanced > disable http 1.1 , http 1.1 through proxy, sdk continue work in uwp runtime. not real solution problem, brings 1 step closer finding underlying cause.
Comments
Post a Comment