wap dialogs deprecated on july 2012

自闭症网瘾萝莉.ら 提交于 2019-12-24 11:28:00

问题


I've just tried the Facebook C# SDK v6.0.16 from earlier this week in a WP7.1 (Mango) app.

The goal is to post a photo on the wall of a user through a facebook app, so I started to implement login to get an access token. Bad surprise, I can't get a combination that works fine:

  • using the desktop page give a very small display on the phone screen
  • using the mobile page is fine, however gives the following error after login is successful:

"An error occurred with YOURAPP. Please try again later. API Error Code: 11 API Error Description: This method is deprecated Eror Message: Display=wap dialogs have been deprecated. Yo can temporarily enable them by disabling the "july_2012" migration. They will stop working permanntly on July, 2012."

The code I use is:

    private Uri GenerateLoginUrl(string appId, string extendedPermissions)
    {
        var parameters = new Dictionary<string,object>();

        parameters["client_id"] = appId;
        parameters["mobile"] = true;
        parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
        parameters["response_type"] = "token";
        parameters["display"] = "touch";
        if (!string.IsNullOrWhiteSpace(extendedPermissions))
            parameters["scope"] = extendedPermissions;

       return fb.GetLoginUrl(parameters);
    }

and the generated urlLogin is m.facebook.com/dialog/oauth?etcetcetc, from the SDK itself.

It looks to me that the SDK itself breaks with the deprecation of the API, or that I am missing something.

Any suggestion? Thank you


回答1:


The C# SDK is no longer supported by Facebook, so FB will not fix issues in it.




回答2:


It should be enough just to change the display parameter to page

var parameters = new Dictionary<string, object>();
parameters["client_id"] = appId;
parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
parameters["response_type"] = "token"; 
parameters["display"] = "page";
if (!string.IsNullOrEmpty(extendedPermissions))
{  
    parameters["scope"] = extendedPermissions; 
}
return _fb.GetLoginUrl(parameters);


来源:https://stackoverflow.com/questions/10341795/wap-dialogs-deprecated-on-july-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!