0

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

Community
  • 1
  • 1
bevanb
  • 8,201
  • 10
  • 53
  • 90

1 Answers1

0

The problem was in my routes file (it's a Rails app), I was only geting /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"`
bevanb
  • 8,201
  • 10
  • 53
  • 90