避免错误100:应用程序请求对话框中的无效参数(需要有效的重定向URI) [英] Avoiding error 100: invalid parameter (requires valid redirect URI) in application requests dialog

查看:163
本文介绍了避免错误100:应用程序请求对话框中的无效参数(需要有效的重定向URI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Facebook开发游戏。我需要一种方式让用户邀请他人参加比赛。为此,我使用apprequests对话框。我将用户重定向到对话框URL,我粘合在一起,如下所示:

  $ 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屋!

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