Skip to content

Instantly share code, notes, and snippets.

@dsplaisted
Last active December 19, 2015 18:38
Show Gist options
  • Save dsplaisted/6000059 to your computer and use it in GitHub Desktop.
Save dsplaisted/6000059 to your computer and use it in GitHub Desktop.
Portable Facebook C# SDK, HttpClient, and platform specific APIs

(This is in response to this conversation on Twitter.)

I don't recommend using dynamic or reflection to call platform-specific APIs in most cases. Generally, create an abstraction and then implement it in a platform-specific API. The nice thing about our portable HttpClient package is that we do that for you so you pretty much don't have to worry about it.

WriteStreamBuffering can be disabled on WP8 (but not WP7). When using the latest RC of portable HttpClient 2.2 on WP8, we will disable it automatically for you under certain conditions. I believe those conditions are that you've disabled automatic redirection and authentication. @theesj can confirm that.

Here are some blog posts about calling platform-specific APIs from PCLs:

Also, see my PCL Storage library for an example of a slightly different way to do this.

We would love to see a portable version of the Facebook .NET SDK, so do let us know if you have any questions or issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment