0

I've made a facebook application and added it to a fan page. I've also added some code to send friend requests and it redirects fine after the dialog.

However, the notifications received by friends are pointing to a URL of this type:

https://apps.facebook.com/APP_NAME/?fb_source=notification&ref=notif

Instead of this type:

https://www.facebook.com/PAGE_NAME/app_123456789

Is there a way to set up notifications so they point to the second URL ?

My current Application setup is as follows:

Website with Facebook Login

App on Facebook

Page Tab

James P.
  • 19,313
  • 27
  • 97
  • 155

1 Answers1

2

However, the notifications received by friends are pointing to a URL of this type:

Of course they do – the requests docs mention this very clearly, that accepting a request will always take the user to the canvas URL of the app.

Is there a way to set up notifications so they point to the second URL ?

No. But you can use JavaScript on your canvas URL to redirect to the page tab URL.

If you want to do this in general, or only under specific circumstances (is it a request at all or just a normal visit of the canvas page, does the request have special parameters deposited in it’s data parameter, etc.) – that’s up to you.

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • Ok. What I've done is use javascript to simply bring up the invite friends dialog and go back to the tab application afterwards. I'll follow your suggestion of using js for redirection. What I could do is check the top url for an `fb_source` parameter. I suppose this should be done in js too as not possible in PHP. – James P. Sep 13 '12 at 15:40
  • 1
    If by top url you mean the address of the Facebook page – you can not access that from within the iframe (same origin policy). A better way to detect if your page got loaded as canvas or page tab app is to check the `signed_request` parameter for a `page` entry. Or – just have the canvas URL point to something like `example.com/?am_i_canvas=true` – that way you can tell in your server side script immediately, what’s the case. – CBroe Sep 13 '12 at 15:44
  • Thanks for your input. You appear knowledgeable on the subject. Will look into `signed_request` :) – James P. Sep 13 '12 at 15:48