Facebook应用程序:本地主机不再适用于应用程序域 [英] Facebook App: localhost no longer works as app domain

查看:199
本文介绍了Facebook应用程序:本地主机不再适用于应用程序域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Rails和jQuery为Facebook写一个游戏。自从我开始使用Facebook Javascript SDK,使用localhost作为应用程序域似乎工作正常。我能够在本地和Heroku上测试我的游戏。



在过去的一天,Facebook似乎对开发人员UI做了大量的更新。现在,如果我添加本地主机作为一个应用程序域,它给我以下错误:


这必须是从Canvas URL,安全的画布URL ,网站网址,手机网站网址,网页标签网址或安全网页标签网址。检查并更正以下域:localhost


我的游戏现在在本地不工作,当Javascript SDK记录时我收到错误在用户中:


API错误代码:191 API错误说明:指定的URL不是应用程序所拥有的
错误消息:无效的redirect_uri:给定
应用程序配置不允许URL。


当我部署我的游戏,因为herokuapp.com被认为是一个有效的应用程序域。



如果我不能再使用localhost或127.0.0.1,我应该如何开发和测试我的游戏?

解决方案

协议似乎不断变化,而接受的答案对我今天没有帮助。如果它帮助其他搜索者,这是对我有用的:




  • 所有更改都是在设置页面的基本选项卡



1)在第一个选项框的中央点击+添加平台,选择网站适用于您的应用程序。)



2。)在刚刚添加的网站的框中:站点URL: http:// localhost:3000 /



3)在上面的框中(Settings => Basic):应用程序域: localhost



4))在右下角点击保存更改



5。)确保您将应用ID复制并粘贴到代码中。 (如果您再次需要,则该ID位于该页面的第一个框中。)


I've been writing a game for Facebook using Rails and jQuery. Since I started using the Facebook Javascript SDK, using localhost as an app domain seemed to work just fine. I was able to test my game both locally and on Heroku.

In the past day, it seems that Facebook has made a big update to their developer UI. Now if I add localhost as an app domain, it gives me the following error:

This must be derived from Canvas URL, Secure Canvas URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains: localhost

My game also now doesn't work locally and I get an error when the Javascript SDK logs in the user:

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

This doesn't happen when I deploy my game, since herokuapp.com is considered a valid app domain.

How am I supposed to develop and test my game if I can no longer use localhost or 127.0.0.1?

解决方案

The protocol seems to keep changing, and the accepted answer didn't work for me today. In case it helps other searchers, this is what did work for me:

  • All changes were made on the Settings page under the Basic tab

1.) In the center under the first box of options, click "+ Add Platform" and choose "Website" (or whatever is appropriate for your app.)

2.) In the box that comes up for the website you just added: Site URL: http://localhost:3000/

3.) In the box above that (Settings => Basic): App Domain: localhost

4.) At the bottom right - click "Save Changes"

5.) Make sure you have the app ID copied and pasted correctly into your code. (The ID is in the first box on that page if you need it again.)

这篇关于Facebook应用程序:本地主机不再适用于应用程序域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆