避免错误100:应用程序请求对话框中的无效参数(需要有效的重定向URI) [英] Avoiding error 100: invalid parameter (requires valid redirect URI) in application requests dialog
问题描述
$ url =http:// www。 facebook.com/dialog/apprequests?app_id=\".$id.\"&message=\".urlencode(\"foobar\").\"&redirect=\".urlencode(\"http://some.arbitrary.url.com );
(当然,不是任意的论据,在导航时,用户被API错误代码:100,API错误描述:无效参数,错误消息:需要有效的重定向URI所骂。我已经搜索了一个解决方案,但似乎所有收到这个错误的人都忘记了他们的URL /消息。我还尝试了一些应该被接受的网址,没有备注,例如应用程序画布URL。
有谁知道我犯了什么错误?
,结果是使用 redirect_uri
和不转义重定向到的URL,所以我之前写的代码应该是: p>
$ url =http://www.facebook.com/dialog/apprequests?app_id=\".$id.\"&消息= .urlencode( foobar的)。 &安培;。 REDIRECT_URI = http://some.arbitrary.url.com;
I'm developing a game for Facebook. I need a way for users to invite others to the game. For that, I use the apprequests dialog. I redirect the user to the dialog URL, which I glue together like this:
$url = "http://www.facebook.com/dialog/apprequests?app_id=".$id."&message=".urlencode("foobar")."&redirect=".urlencode("http://some.arbitrary.url.com");
(Of course, with not-so-arbitrary arguments, but they still look sane to me.) Upon navigating there, the user is scolded by "API Error Code: 100, API Error Description: Invalid Parameter, Error Message: Requires valid redirect URI.". I googled around for a solution, but it seems that all the people receiving this error were forgetting to escape their URLs / messages. I also tried some URLs that should be accepted without remarks, like the application canvas URL.
Does anyone know what mistakes am I making?
So, turns out the solution is to use redirect_uri
and not to escape the URL to redirect to, so the code I wrote before should read:
$url = "http://www.facebook.com/dialog/apprequests?app_id=".$id."&message=".urlencode("foobar")."&redirect_uri="."http://some.arbitrary.url.com";
这篇关于避免错误100:应用程序请求对话框中的无效参数(需要有效的重定向URI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!