0

I am using java script Facebook request calling this

FB.ui({
         method: 'apprequests',
         message: "You should learn more about this awesome site."
       });

The user is prompted with some dialog box and send his invitation. This works well. But, when the invited user clicks on the invitation, he is redirected to

https://apps.facebook.com/MyAPP/?fb_source=notification&request_ids=someId&ref=notif&app_request_type=user_to_user&notif_t=app_request

the problem is that this page is blank like a 404 page but at the top, the Facebook header is displayed. Is there a way to redirect the user to the page site from where the request was sent ?

user1611830
  • 4,749
  • 10
  • 52
  • 89

1 Answers1

0

App Requests always go to the Canvas Page, so you have to add that Platform in the Developer Settings. You could redirect to an external Website from there, but that´s not allowed. See this thread for more information: Redirect from Facebook canvas page to website

Btw, App Requests are intended for Canvas Apps, not for external Websites. In your case you should rather use the Send Dialog to send something to a friend.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • thank you but I am really not familiar to Facebook app. Where should I put this code ? Is there a way to do that by setting some param in the app setting dashboard ? Btw, suppose I have to customize this code on my site (the one whose url is `www.mysite.com`), how can I set get some uri param so I can redirect to the right page from which the request was sent ? – user1611830 Jul 15 '14 at 20:30
  • this would be a bit more complicated, you would have to store the reference to the right page with the request id in order to redirect to the correct page. – andyrandy Jul 15 '14 at 20:34
  • anyway, go to the settings of your app and click on "add platform" to add a canvas page. there you have to enter a link to your website. keep in mind that you also need a server with ssl for this. and as i said: it is against the facebook policy to use a canvas page just to redirect to an external website, and app requests are not allowed on external websites. – andyrandy Jul 15 '14 at 20:36
  • this request id is reachable in the callback method of `FB.ui` ? – user1611830 Jul 15 '14 at 20:37
  • check out the docs, plenty of information in there: https://developers.facebook.com/docs/games/requests/v2.0 – andyrandy Jul 15 '14 at 20:39
  • but again, this does not matter at all, because what you want to do is just not allowed. as i suggested, just use the send dialog. much easier to handle anyway. – andyrandy Jul 15 '14 at 20:41