Skip to content

Commit

Permalink
Merge branch 'content'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Totten committed Jun 26, 2013
2 parents ea3ea01 + 8c30729 commit c97954a
Show file tree
Hide file tree
Showing 381 changed files with 77,448 additions and 3,620 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
_site
_site
.DS_Store
37 changes: 24 additions & 13 deletions 404.html
Expand Up @@ -27,7 +27,7 @@

<body>
<div class="navbar navbar-fixed-top">
<a href="http://github.com/facebook-csharp-sdk/facebook-csharp-sdk"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<a href="http://github.com/facebook-csharp-sdk/facebook-csharp-sdk"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
Expand All @@ -38,29 +38,40 @@
<a class="brand" href="#">Facebook SDK for .NET</a>
<div class="nav-collapse">
<ul class="nav">
<li><a href="/docs">Overview</a></li>
<li><a href="/docs/web">Web</a></li>
<li><a href="/docs">Docs</a></li>
<li><a href="/docs/reference">SDK Reference</a></li>
<li><a href="/docs/windows">Windows 8</a></li>
<li><a href="/docs/azure">Windows Azure</a></li>
<li><a href="/docs/phone">Windows Phone</a></li>
<li><a href="/docs/web">Web</a></li>
<li><a href="/docs/about">About</a></li>
</li>
</ul>
</div>
</div>
</div>
</div>

<div id="top" class="container content">
<h1>404: Page Not Found</h1>

<p>The content you were looking for was not found.</p>
<div class="main-container">
<div class="error-container">
<div class="header">
<h1>Page not found</h1>
</div>
<p>The page you requested was not found.</p>

<ul>
<li><a href="/">Return home</a></li>
<li><a onclick="history.back()">Go back to the previous page</a></li>
</ul>
</div>
</div>

<footer class="footer">
<p class="pull-right"><a id="back-to-top" href="#top">Back to top</a></p>
<p>Copyright &copy; 2012, <a href="http://www.outercurve.org">The Outercurve Foundation</a>.</p>
<p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>. Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
</footer>
<footer class="footer">
<div class="container-footer">
<p class="pull-right"><a href="#">Back to top</a></p>
<p class="pull-right"><a href="/docs/about/#2">License</a></p>
<p>Copyright &copy; 2012 &sdot; <a href="http://www.outercurve.org">The Outercurve Foundation</a>.</p>
</div>
</footer>

</div>
</body>
Expand Down
4 changes: 4 additions & 0 deletions BingSiteAuth.xml
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<users>
<user>EC55DDFC6C7DDE79B205A87619F80BA7</user>
</users>
3 changes: 2 additions & 1 deletion _config.yml
@@ -1,2 +1,3 @@
markdown: rdiscount
pygments: false
pygments: false
permalink: pretty
4,951 changes: 4,951 additions & 0 deletions _design/ConceptsSubIcon/subicon 3.ai

Large diffs are not rendered by default.

Binary file added _design/ConceptsSubIcon/subicon 3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/ConceptsSubIcon/subicon 3.psd
Binary file not shown.
5,064 changes: 5,064 additions & 0 deletions _design/ConnectedWebPhoneMainIcon/icon 4.ai

Large diffs are not rendered by default.

Binary file added _design/ConnectedWebPhoneMainIcon/icon 4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/ConnectedWebPhoneMainIcon/icon 4.psd
Binary file not shown.
4,998 changes: 4,998 additions & 0 deletions _design/FBWebSubIcon/subicon 4.ai

Large diffs are not rendered by default.

Binary file added _design/FBWebSubIcon/subicon 4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/FBWebSubIcon/subicon 4.psd
Binary file not shown.
4,996 changes: 4,996 additions & 0 deletions _design/GamesSubIcon/subicon 5.ai

Large diffs are not rendered by default.

Binary file added _design/GamesSubIcon/subicon 5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/GamesSubIcon/subicon 5.psd
Binary file not shown.
5,050 changes: 5,050 additions & 0 deletions _design/GettingStartedSubIcon/subicon 1.ai

Large diffs are not rendered by default.

Binary file added _design/GettingStartedSubIcon/subicon 1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/GettingStartedSubIcon/subicon 1.psd
Binary file not shown.
5,017 changes: 5,017 additions & 0 deletions _design/MobileSubIcon/subicon 6.ai

Large diffs are not rendered by default.

Binary file added _design/MobileSubIcon/subicon 6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/MobileSubIcon/subicon 6.psd
Binary file not shown.
4,953 changes: 4,953 additions & 0 deletions _design/ReferenceSubIcon/subicon 2.ai

Large diffs are not rendered by default.

Binary file added _design/ReferenceSubIcon/subicon 2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/ReferenceSubIcon/subicon 2.psd
Binary file not shown.
5,073 changes: 5,073 additions & 0 deletions _design/WebMainIcon/icon 3.ai

Large diffs are not rendered by default.

Binary file added _design/WebMainIcon/icon 3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/WebMainIcon/icon 3.psd
Binary file not shown.
5,010 changes: 5,010 additions & 0 deletions _design/WindowsMainIcon/icon 2.ai

Large diffs are not rendered by default.

Binary file added _design/WindowsMainIcon/icon 2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/WindowsMainIcon/icon 2.psd
Binary file not shown.
4,909 changes: 4,909 additions & 0 deletions _design/WindowsPhoneMainIcon/icon 1.ai

Large diffs are not rendered by default.

Binary file added _design/WindowsPhoneMainIcon/icon 1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _design/WindowsPhoneMainIcon/icon 1.psd
Binary file not shown.
147 changes: 147 additions & 0 deletions _includes/howtos/batch-requests.md
@@ -0,0 +1,147 @@
If your application needs the ability to access significant amounts of data in a single go - or you need to make changes to several objects at once, it is often more efficient to batch your requests rather than make multiple individual requests.

This document walks through the following topics:

* [Prerequisites](#1)
* [Sample Overview](#2)
* [Step 1: Set Up the User Interface](#3)
* [Step 2: Send the Batch Request](#4)
* [Best Practices](#5)
* [Additional Info](#6)

---

## Prerequisites

Before you begin, make sure you already set up [Facebook Login](../login). This ensures you have the prerequisites and your app is ready for additional Facebook integration.

---

## Sample Overview


The completed sample demonstrates fetching user information via a Batch Request.

The implementation builds on top of Facebook Login, adding a button that initiates a Batch Request and displays the retrieved data.


->![Running solution](images/running-solution.png)<-

---

## Step 1: Set Up the User Interface

In this step, you'll add a button in the initial layout that launches the Batch Request.

First, open the Main.xaml file and add a button control to the main page just below the login button as well as a TextBlock to hold the results of our Batch Request.

{% if page.platform == 'phone' %}
<Button
x:Name="queryButton"
Height="70"
Width="300"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Margin="0,100,0,0"
FontSize="20"
Content="Batch Request"
Visibility="Collapsed" />

<TextBlock
x:Name="txtResults"
Width="400"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Margin="0,190,0,0"
TextWrapping="Wrap"
Text=""
FontSize="20" />

{% endif %}

{% if page.platform == 'windows' %}
<Button
x:Name="queryButton"
Height="70"
Width="200"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Margin="0,290,0,0"
FontSize="20"
Content="Batch Request"
Visibility="Collapsed" />

<TextBlock
x:Name="txtResults"
Width="400"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Margin="0,390,0,0"
TextWrapping="Wrap"
Text=""
FontSize="20" />
{% endif %}

The button will be set to hidden initially.

If you followed the [Facebook Login](../login) doc, you should have a _OnSessionStateChange()_ event handler in your Main.xaml.cs class file that is invoked whenever the user session state changes. Modify this method to show the buttons only when the user is authenticated:

private void OnSessionStateChanged(object sender, Facebook.Client.Controls.SessionStateChangedEventArgs e)
{
if (e.SessionState == Facebook.Client.Controls.FacebookSessionState.Opened)
{
this.queryButton.Visibility = Visibility.Visible;
}
else if (e.SessionState == Facebook.Client.Controls.FacebookSessionState.Closed)
{
this.queryButton.Visibility = Visibility.Collapsed;
}
}

---

## Step 2: Send the Batch Request

In this step, you'll add the logic to send the Batch Request.

Let's assume you have a list of ids that you want to get names for. For this example, we'll simply use a list consisting of the logged-in user and Mark Zuckerberg.

Implement the query button's click event handler to instantiate the FacebookClient object and sends the Batch Request. In the Main.xaml page, set the Click attribute of the "Batch Request" button as shown below.

<Button
x:Name="queryButton"
...
Click="OnBatchRequestButtonClick" />

Add the following code in the Main.xaml.cs file to implement the OnBatchRequestButtonClick event handler:

private async void OnBatchRequestButtonClick(object sender, RoutedEventArgs e)
{
var fb = new Facebook.FacebookClient(this.loginButton.CurrentSession.AccessToken);

dynamic result = await fb.BatchTaskAsync(
new Facebook.FacebookBatchParameter("me"),
new Facebook.FacebookBatchParameter("4"));

txtResults.Text = string.Format("{0}: {1}\n{2}: {3}", result[0].id, result[0].name, result[1].id, result[1].name);
}

Build and run the project to make sure it runs without errors. Tap the _Log In_ button to log in with Facebook. Once authenticated, tap _Batch Request_ and verify that you see your id and name as well as Mark Zuckerberg's info.

---

## Best Practices

Execute your batch requests asynchronously (with _facebookClient.BatchTaskAsync()_) to avoid running your requests in the UI Thread. This improves performance.

---

## Additional Info

- [BatchTaskAsync][1] - Reference for BatchTaskAsync Methods in Facebook Client class
- [FacebookBatchParameter][2] - Reference for FacebookBatchParameter class
- [Handling Facebook API Errors][3]: Graph API topic on error handling

[1]: /docs/reference/SDK/Facebook.FacebookClient.html#BatchTaskAsync(FacebookBatchParameter[])
[2]: /docs/reference/SDK/Facebook.FacebookBatchParameter.html
[3]: https://developers.facebook.com/docs/reference/api/errors/

0 comments on commit c97954a

Please sign in to comment.