When users send app requests, the requests point to the canvas page instead of the page tab.
I know the solution is to point your Canvas App URL to a page that redirects to the page tab. However, it's not working.
This is the JS on my redirect page:
top.location.replace("#{PAGE_TAB_URL}");
Going to the redirect page directly (myapp.com/redirect) will redirect to the page tab fine. But for some reason, requests don't work. When users click to view the request, my app returns a 404.
Is there some problem with top.location.replace
within Facebook?
The following question's solution did not work for me: FB app request points to canvas page instead of page tab
The problem was in my routes file (it's a Rails app), I was only get
ing /redirect, and wasn't handling post
, which is what happens in a page tab. Working solution:
On redirect page:
`window.top.location.href = "#{PAGE_TAB_URL}";`
routes.rb:
`match "redirect" => "home#redirect"`
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.