简体   繁体   English

将用户允许使用Facebook应用后将用户重定向到动态页面?

[英]redirect the user to dynamic page after they allowed the facebook app?

I have images on my website that the user needs to allow the Facebook application in order to view them. 我的网站上有用户需要允许Facebook应用程序才能查看的图像。 So when the user click on the image (thumbnail) it should talk him to the image page and check if he allowed the application. 因此,当用户单击图像(缩略图)时,应该让他进入图像页面并检查他是否允许该应用程序。 So how do I redirect the user to the user to that specific image page after allowing the Facebook application. 因此,在允许使用Facebook应用程序后,如何将用户重定向到该特定图像页面的用户。 something like this: 像这样的东西:

header('Location: image_page.php');

I tried this it is taking him to the allow page on facebook again. 我试过了,这又把他带到了Facebook的允许页面。 I tried to change the -1 but I got the same problem: 我尝试更改-1,但遇到了相同的问题:

header("location:javascript://history.go(-1)");

最简单的方法是将引用页面的URL填充为您在调用Facebook身份验证对话框时指定的redirect_uri

you should specific the image page when redirect the user to facebook to allow your application. 将用户重定向到Facebook以允许您的应用程序时,您应该指定图像页面。

here is the url to redirect user to Facebook auth: 这是将用户重定向到Facebook身份验证的URL:

https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_CANVAS_PAGE

you should replace YOUR_CANVAS_PAGE with your image page url 您应该使用图片页面网址替换YOUR_CANVAS_PAGE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM