How to implement href attribute in facebook notification? - facebook

From FB oficial documentation
When people click the notification, they'll be taken to a URL you
specify with the notification.
I have been strugling to understand what canvas app actually is. I have managed to actually send and recieve notification, however when clicking to notification fb redirects me to apps.facebook.com/1111111111111111/home?fb_source=notification&fb_ref=test where a lot of 1`s is meant my app id(did not know if I should protect that so better protect) and "home" is href I specified in href parameter when making post to userid/notifications endpoint. The first part is exactly as in my settings tab listed canvas page but I can not change it.
I expected that on click I would be redirected to my website. Could some one please explaine me what have I misunderstood? I think the problem is that I really do not understand what fb canvas app is and how it works.

Related

Change Facebook comment tool notification URL?

I have created an app using Facebook Canvas and loaded it as a Page Tab on a Facebook Page. The app is basically a simple site that contains several pages, each with an own comment section (Facebook Comments).
When someone leaves a comment and I reply to it, that person gets a Facebook notification saying "[Name] replied to your comment on [url]". There are two issues with this:
1. The server that we put the app on has an ugly url. We do not want to show the url anywhere. That's why we wanted to use the Facebook Canvas in the first place - so that you could view the app inside Facebook and not on the server itself.
2. When you click the notification, it brings you to the app OUTSIDE of Facebook. It sends to you that ugly url. I wish for it to take you to the app INSIDE Facebook, that is facebook.com/[our_page]/app_[app_id]
I was wondering if there is there any way to 1) change the url that the notification outputs and 2) the url that the notification sends you to.
Hope someone can help with this!
I have found that setting the data-href to the https://apps.facebook.com/app-name solves the problem. When someone uses the comments form and they are replied to, the Facebook notification will say "[Name] replied to your comment of [App name].
The issue that remains is that this does not give you a separate comment tool on each page.

Redirect Facebook App To External Page

I'm having issues configuring my Facebook app to behave as I want when posting information via the Feed Dialog. I've set up an app and created a link that correctly posts my content when clicked, but I can't figure out how to make the link to the app in the resulting post redirect where I want it to.
As an example, here's a post made via Instagram.
If I click on the 'via Instagram' link, I get either prompted or automatically redirected from the destination URL http://www.facebook.com/apps/application.php?id=124024574287414 to www.instagram.com.
I've seen other posts suggest you can do something similar using a JavaScript redirect from the App Canvas page, and I've got a proof of concept doing this, but since I've seen Instagram and other apps do this seemingly internally to Facebook I'm convinced it's possible to do more cleanly.
That link goes to your app's canvas URL (apps.facebook.com/something) or website URL as defined in the app settings, it can't be configured with any more granularity.
This seems that it will probably do the trick most easily: http://woobox.com/statichtml
See the redirect radio button in the image they have.

top.window.location from within a facebook canvas app?

There are circumstances where I'd like a link to break out of facebook canvas' iframe. For example, if I'm linking to to the apple app store, it seems more prudent to have the link target="_top" or top.window.location.
Are there any circumstances in which it is against fb policy to link out to the top window?
I think you have to do this if you are setting cookies and such. When the user first visits, I capture the signed_request, and send them to a different URL via window.parent.location.
Then once they've authenticated on my domain (where I can set 1st party cookies easily), I send them back into the canvas application to a specific page.
If there's a better way I'd love to hear it.

Facebook search for app redirect

I recently build an iframe app for within Facebook, and for facebook only. So no need to call the iframe outside of Facebook. The only problem i have now, is that as soon as i search for the app like this:
http://i44.tinypic.com/30rla83.png
I get the following warning: http://i43.tinypic.com/2uh1w20.png
I can't seem to find out how to configure the app so it won't redirect, but goes directly to the app itself. The only values set are the 'Website' and 'Page Tab' value. When i set a value for the 'App on Facebook', the iframe gets included in the game/app format (with Facebook games in the right bar) by Facebook, and not the Facebook page app content format.
And when i delete or adjust the 'Website' value and i use Facebook search, i get the error that the app is not configured correctly. It's now set to the full addresss outside of Facebook, because when i configure it to the Facebook App URL i get the same error.
The only value i'm sure of is the 'Page Tab' value.
Thanks in advance guys, i can't seem to find the answer myself..
UPDATE: it turns out the 'you are being redirected'-page only occurs with my Facebook profile! Probably because I'm the Facebook Page admin or the app creator? Anyway, as far as I'm concerned; case closed and problem solved :)
It's slightly confusing which options apply to what types of app on Facebook - and the behaviour of the search is slightly unintuitive but here are some pointers that might help you:
If your app is going to only exist as a page tab, it doesn't really make sense to search for it (it could theoretically exist on multiple facebook pages). These won't show up in search results unless you have also set one of the following two options as well
If you have set up your app as a canvas app, "app on facebook" in the developer settings then when you search for the App, it will redirect you to the canvas page (your iframe being pulled into a Facebook canvas.
if you have set your app up to work with Facebook Connect "Log in to my website using Facebook." in the developer settings, and you haven't also set up your app to operate as a canvas app, then Facebook will assume that you have a web app that is external to Facebook, and searches will redirect the user to your website url.
So, what you probably need to do is either remove your website url from your facebook settings if you aren't using Facebook Connect (in which case your app won't show up in Search results) or create a canvas page as well, which redirects you to the correct facebook page tab.

invite friends function of hackbook for iphone doen't work on my iphone4s

i downloaded hackbook from https://github.com/facebook/facebook-ios-sdk/tree/master/sample/Hackbook (* i am not sure this is the right place to download it), because i wanted to know how to send an invitation to a friend from a iphone native application.
i clicked "send invite", then on the pop-up page, I selected a friend(another facebook account of mine) and pushed "send" button.
"Sent request successfully." is displayed on the bottom of the screen.
but I don't get any request.
who can tell me how to send an invitation, better if there is a sample.
thanks in advance.
Check if your application is in sandbox mode. Users who are not listed as developers/testers will not receive invites to applications that they do not have the permissions to view.
UPDATE:
As the OP has discovered (see comments below) - the problem was to do with not having a Canvas URL set up in the application settings.
Im not 100% sure why this is ( being an iPhone native application ). Reading through the documentation ( once again :S ) revealed no stated requirement of the Canvas URL. My best guess is that the request needs to be able to be redirected somewhere after it is accepted, if you dont specify the canvas URL maybe somehow you invalidate the request.
Did all the requests that did not go out appear once you specified the Canvas URL?