I am trying to add an app to my facebook fan page account for oAuth login.
I DONT WANT A TAB so the method i thought might work was method: 'apprequests'
but i keep getting an error: An error occurred with Prayerfish Login. Please try again later.
any suggestions on how to get the app over to my fan page?
note** this html page is from facebooks tutorial
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>My Add to Page Dialog Page</title>
</head>
<body>
<div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p><a onclick='addToPage(); return false;'>Add to Page</a></p>
<p id='msg'></p>
<script>
FB.init({appId: "****************", status: true, cookie: true});
function addToPage() {
// calling the API ...
var obj = {
//method: 'pagetab',
method: 'apprequests',
redirect_uri: 'https://www.myDomain.com',
};
FB.ui(obj);
}
</script>
</body>
</html>
The only way to have an app on a Facebook Page is to add it as a "tab". Since the switch to Timeline, tab has become a bit of a misnomer as it is more correct that it is just a bookmark at the top of your Page (for example on Spotify's Page the 'Get Spotify', 'Fan Playlist' and 'Summer Sounds' thumbnails at the top of the page are technically 'Page Tabs').
If you still want to add the app to your Page as a 'tab', the code you included above is actually more complex than you need. That code is what you would include on your website, for example, if you wanted to allow admins of other Facebook Pages to install your app. Because you own both the Page and the app, you just need to modify this link to include your app ID and URL and click on it:
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&display=popup&next=YOUR_APP_URL
When you do, you'll see a dialog asking you to pick which Page you want to add the app to, choose that and you're done.
If you were already aware of what a Page Tab is and don't want that, my question would be - how do you want the app to appear?
Related
My facebook application redirects the user a page where they give the application window correctly when they visit the website (http://toolshed.herokuapp.com/), but not when they visit the canvas page in Facebook (https://apps.facebook.com/toolshed/). Once a user has given permission to the application, both places work correctly. The main problem here is that when a user goes to the page on Facebook first, all they see is a blank page. Any ideas? The code can be found at https://github.com/runninggraeb/toolshed, but I doubt it's a coding issue. Any help would be appreciated.
Ryan
Answer: To clarify to future viewers, I did redirected to this page within the app for authentication. "top.window.location" gets me out of the iFrame.
<!DOCTYPE html >
<html xmlns:fb="http://ogp.me/ns/fb#" lang="en">
<script>
window.top.location = '<%= authenticator.url_for_oauth_code %>'
</script>
</html>
You can not display the Auth dialog in any kind of frame. (As has been said here already many times before …)
You have to redirect to it in the top most window instance.
I have following code in html file:
<html>
<head>
<title>My Great Website</title>
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:'156154681125939', cookie:true,
status:true, xfbml:true
});
FB.ui({ method: 'apprequests',
message: 'Here is a new Requests dialog...'});
</script>
</body>
</html>
I am using this code to send apprequests for my app (reference: http://developers.facebook.com/blog/post/464/)
Problem: I am able to load Request dialogue by above code, and it shows my friend list. Also I can send invited then. Say suppose I send the invite to friend "X" (provided "X" is not already using my app). Then in X's FB account, apprequest bookmark count is increases by 1. But when X is trying to see app invite, he actually cannot see any app invite received for my app. I have tried this with at least 5 users, all are getting their apprequest book incremented by 1 after I send the invite to them, but when they see the invite, there is actually no invite present.
Can anyone suggest me that what is the problem?
Note: My app is website (and not canvas app), also I have hosted above demo code on my server at http://www.gmarjil.com/a.html
This is the expected behavior of non-canvas applications. Requests always redirect to the application's canvas URL and if it is not set the request is not displayed.
The request is still sent (this is why the requests count is increased), you can access it via the graph API (https://graph.facebook.com/{user_id}/apprequests, needs app access token).
Even if your app is not a game you can give any url as the canvas uri in the facebook app setting.The url even if invalid will allow teh notifications to send.This solved my issue.
I want to capture Like button click event in facebook page in my facebook.
http://www.facebook.com/wineselectors
If anyone click on like button, it should open a popup window of page tab http://www.facebook.com/wineselectors?sk=app_190348341034091
I have used to below code to capture like click, but it is not working.
<html> <script type="text/javascript">
FB.Event.subscribe('edge.create', function(response) {
alert('the user likes a page');
});
</script> <body> <center> <img src="http://www.wineselectors.com.au/images/UserUploadedImages/facebook-like--image.jpg" /> </center> </body> </html>
I am trying to develop an aspx page for welcome tab but how can I get signed_request in my aspx page and how to decode the signed_request. I have read some of the articles they were using Jason but i could not able to use Jason in my system.
When someone likes your page, the page gets completely refreshed and you would need to decode and inspect the signed_request HTTP POST parameter in server code (not javascript) to see if they like your page. Then from there you could redirect the user as necessary.
I have a facebook application and when it posts to a users stream it shows the application name and clicking that directs the user to the applications profile page. Is it possible to change this link to another page or set the application profile page to load another page?
I'm not sure about changing the link but you can make one page automatically load another page.
See an example on our fan page here: http://www.facebook.com/pages/Premier-League-Prophet/193957803989227
When you visit this page it automatically redirects to our app profile page instead at http://www.facebook.com/apps/application.php?id=105260882892290
1) Add the "Static HTML: iframe tabs" app to your page. This lets you configure any static HTML as the source for a page tab.
2) Use a quick bit of redirect code so that when the tab loads it automatically redirects the browser to where you want to go:
<html>
<head>
</head>
<body>
<script language="JavaScript">
// Redirect to chosen destination
top.location.href = "http://www.googl.com/";
</script>
</body>
</html>
3) In the page config, set the new tab as the default tab for the page.
One small limitation. The default tab setting is only respected if the user has not yet liked the page. If they have liked the page, then the wall is displayed by default. However, if you're configuring the page to auto-redirect, this shouldn't be a problem, because no visitor to the page will stay on it long enough to like it.
I'm a new Facebook developer. I want to add comments box to my application and I follow the tutorial in Facebook wiki. It's not work in my application.
My canvas callback URL is http://122.155.0.71/~facebook/ and I upload xd_receiver.htm to root directory. I am using the following code
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2" type="text/javascript"></script>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
<fb:comments> </fb:comments>
<script type="text/javascript">FB.init("b6e07896a1d0889d9784dea150802587", "/xd_receiver.htm");</script>
in my application. It not show up. When I view this page with Firebug. I see <fb:comments> </fb:comments>. I don't know about xid, where can I create it?
This tag allow user to post comments in my FBML and display these comments on their Wall. But for some cause, comments can not be displayed in users' Wall even they checked the box "Post comment to my Facebook profile".
I don't know what was wrong with the code
I really appreciate if you can help.
This is my FBML: click here to view
And this is my code:
<fb:comments xid="comment" " canpost="true" candelete="false" numpost="10" publish_feed="true"><fb:title>Comment</fb:title></fb:comments>
I'm working on an iFrame XFBML application and had trouble getting this to work until I realized what it meant for the fb:comments tag to be an "unsupported" XFBML tag. To get this working, you have to wrap the fb:comments call in fb:serverFbml tags.
Here's the full code:
<fb:serverFbml style="margin-top:15px;">
<script type="text/fbml">
<fb:fbml>
<fb:comments xid="project_1" publish_feed="false" showform="true" canpost="true" numposts="50" width="467px"><fb:title>Comment on this project</fb:title></fb:comments>
</fb:fbml>
</script>
</fb:serverFbml>
if you want comment box like this in my app
http://apps.facebook.com/pollonfb
then it very easy ,
just use following code
<fb:comments xid="Identifier" canpost="true" candelete="false" returnurl="http://apps.facebook.com/myapp/titans/">
<fb:title>Talk about the Titans</fb:title>
</fb:comments
XId id simply a unique string to identify your comment box uniquely , For example in my app there is a comment box for each poll , and poll name is xid for their comment box.