我想用asp.net创建一个Facebook IFRAME应用程序。我只是想知道我是否需要通过互联网托管应用程序?如果是,我怎样才能在localhost上测试我的应用程序?
我只想要一个简单的应用程序,用于显示“Hello”的用户名。任何人都可以通过完整的web.config配置向我展示代码吗?
我正在尝试此代码
使用facebook.web; 命名空间TestFbApplication { public partial class _Default:facebook.web.CanvasFBMLBasePage {
facebook.Components.FacebookService _fbService = new facebook.Components.FacebookService();
private const string FACEBOOK_APPKEY = "66a8278bb94d969247a80815bab686e5"; // From the Facebook application page
private const string FACEBOOK_SECRET = "de76280e4ddaef72ac2166afe7ffb9d5"; // From the Facebook application page
protected void Page_PreInit(object sender, EventArgs e)
{
base.RequireLogin = false;
_fbService.IsDesktopApplication = false;
_fbService.ApplicationKey = FACEBOOK_APPKEY;
_fbService.Secret = FACEBOOK_SECRET;
_fbService.IsDesktopApplication = false;
_fbService.ConnectToFacebook();
abc.InnerText = _fbService.users.getInfo().ToString();
}
并且在最后一行中抛出和异常没有设置对象引用。
答案 0 :(得分:1)
您需要在某处托管您的生产应用程序,但您可以在本地进行测试。如果您在Facebook中将Canvas URL设置为http://localhost:81
,这应该可行。几个月前它确实对我有用,但从那以后它们可能已经改变了它。
答案 1 :(得分:0)