wap对话框在2012年7月不推荐使用 [英] wap dialogs deprecated on july 2012
问题描述
我刚刚在WP7.1(芒果)应用程序中尝试了Facebook C#SDK v6.0.16。
目标是发布通过Facebook应用程序在用户的墙上拍照,所以我开始实现登录获取访问令牌。
不好意思,我不能得到一个很好的组合:
- 使用桌面页面给一个非常小的显示手机屏幕
- 使用手机页面正常,但登录成功后会出现以下错误:
$ b $
API错误代码:11
API错误说明:此方法已弃用
错误消息:显示= wap对话框已被哟可以通过禁用7月2012迁移来临时使用它们,他们将在2012年7月永久停止工作。
我使用的代码是:
private Uri GenerateLoginUrl(string appId,string extendedPermissions)
{
var parameters = new Dictionary< string,object> ();
参数[client_id] = appId;
参数[mobile] = true;
参数[redirect_uri] =https://www.facebook.com/connect/login_success.html;
参数[response_type] =令牌;
参数[display] =touch;
if(!string.IsNullOrWhiteSpace(extendedPermissions))
参数[scope] = extendedPermissions;
返回fb.GetLoginUrl(参数);
}
,生成的urlLogin是m.facebook.com/dialog/oauth?etcetcetc ,从SDK本身。
对我来说,SDK本身与API的弃用或者我缺少某些东西分开。
任何建议?
谢谢
只要将显示参数更改为页面
var parameters = new Dictionary< string,object>();
参数[client_id] = appId;
参数[redirect_uri] =https://www.facebook.com/connect/login_success.html;
参数[response_type] =令牌;
参数[display] =page;
if(!string.IsNullOrEmpty(extendedPermissions))
{
参数[scope] = extendedPermissions;
}
return _fb.GetLoginUrl(parameters);
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
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);
这篇关于wap对话框在2012年7月不推荐使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!