You need to create an application on Facebook . Important settings when setting up on facebook:
Connect → Facebook Settings → Connect URL
This URL serves two purposes. First, this URL will be used as the base for your cross-domain link where you host the xd_receiver.htm file.
So, if your url is: http://yoursite.comthen you should have a url file http://yoursite.com/xd_receiver.htmthat allows the JavaScript Client Library for Facebook to run.
However, I highly recommend that you do not use your root URL. Select the subdirectory you are not linking to on your page. Something like this http://yoursite.com/ex/fbwill do nicely (I like it exfor "external", but it is completely subjective).
JavaScript. , , , .
→ →
" ".
, ( ):
- , JavaScript FBML, ( ).
JavaScript API, xd_receiver.htm. ASP.NET, :
<%@ Page Language="C#"%>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script
src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/
FeatureLoader.js.php" type="text/javascript"></script>
</head>
<body>
<fb:login-button></fb:login-button>
<hr>
<fb:prompt-permission perms="offline_access">Click to grant offline
access permission.</fb:prompt-permission>
<fb:prompt-permission perms="publish_stream">Click to grant publish
stream permission.</fb:prompt-permission>
<fb:prompt-permission perms="read_stream">Click to grant read stream
permission.</fb:prompt-permission>
<input type="button" value="Get session key" onclick="
document.all('apikey').value=FB.Facebook.apiClient.
get_session().session_key;" />
<input type="text" size="100px" id="apikey" />
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function () {
FB.Facebook.init("API Key", "xd_receiver.htm URL");
});
</script>
</body>
</html>
:
, , JavaScript fb.
, Facebook Connect. , , .
, fb:prompt-permission . , Facebook, .
, ( ), " ".
. offline_access, Facebook , .
:
- API
- ( )
- , , ( URL- Facebook)
API Facebook .NET. Facebook Developer Toolkit.
Windows Forms , API . , , Windows Forms. .
. , . . ( Facebook) ( ). . , .
, :
, , API, , , ( , , ) - .