GithubHelp home page GithubHelp logo

facebook-csharp-sdk / facebook-csharp-sdk Goto Github PK

View Code? Open in Web Editor NEW
873.0 873.0 448.0 51.37 MB

Facebook SDK for .NET

Home Page: https://github.com/facebook-csharp-sdk/facebook-csharp-sdk

License: Apache License 2.0

C# 97.43% JavaScript 2.52% Batchfile 0.05%

facebook-csharp-sdk's Introduction

Facebook SDK for .NET

The Facebook SDK for .NET helps developers build web, desktop, Silverlight, Windows Phone and Windows Store applications that integrate with Facebook.

Like us on Facebook at our official page or Follow us on twitter @chsarpsdk.

NuGet

Install-Package Facebook

The Facebook SDK for .NET binaries are only distributed via nuget. For those using older versions of Visual Studio that does not support NuGet Package Manager, please download the command line version of NuGet.exe and run the following command.

nuget install Facebook

If you would like to get an older version of the the binaries please use the following command.

nuget install Facebook -v 5.4.1

Documentation

You can find the documentation for this project here.

Help and Support

Use facebook.stackoverflow.com for help and support. We answer questions there regularly. Use the tags 'facebook-c#-sdk' and 'facebook' plus any other tags that are relevant. If you have a feature request or bug create an issue.

Facebook Platform Status

Facebook Change Log

Features

  • NuGet Packages Available (Facebook and Facebook.channel)
  • Compatible with all Facebook Graph and REST API methods.
  • Supports photo/video uploads
  • Supports batch requests and etags
  • Supports Facebook's most current authentication systems.
  • Sample applications and documentation are provided to get you started quickly.

Supported Platforms

  • .NET 3.5 (Client Profile and Full Profile)
  • .NET 4.0 (Client Profile and Full Profile)
  • .NET 4.5
  • Windows Store Apps
  • Silverlight 5
  • Windows Phone 7.1
  • Windows Phone 8

Contribute

Please refer to our official docs on Contributing to Facebook SDK for .NET for more details.

facebook-csharp-sdk's People

Contributors

chrishammond avatar mingulov avatar nguyenquyhy avatar ntotten avatar prabirshrestha avatar psanetra avatar sanjeevdwivedi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook-csharp-sdk's Issues

git line endings

mention about git line endings

git config --global core.autocrlf false

remove IJsonSerializer and JsonSerializer

remove IJsonSerializer interface and add it as a static method/property to FacebookClient

FacebookClient.SetJsonSerializer(Func<object,string> serializeObject, Func<string,Type,object> deserializeObject);
FacebookClient.SerializeObject(object obj);
FacebookClient.DeserializeObject(string json, Type type);

support for E-Tags

https://developers.facebook.com/blog/post/627/

We would most probably want a method that looks similar to this.

dynamic result = fb.Api("GET", "me", new { fields = new { "id", "name"},  etag = "...." });
dynamic headers = result.headers;
dynamic etag = result.headers.etag; 
dynamic body = result.body;

Then result.body actually contains the actual json result.
etag parameter is a special parameter like the "access_token" parameter. it should be set as a request header instead of normal parameter.

unlist Facebook.xd_receiver nuget package

Unlisting a package hides the package from search results and all NuGet commands, but packages are still available for download. For example, they can still be downloaded as dependencies to other packages.
this means your package cannot be installed directly and it will not show up in search results.

rewrite/remove Facebook.Web.dll and Facebook.Web.Mvc.dll

currently there are a lot of unnecessary codes in Facebook.Web.dll and Facebook.Web.Mvc.dll. Most of which will not make sense in the presence context. We will need to rewrite every part of Web and Mvc.

I think only FacebookWebClient would be necessary and all other classes can be removed from Facebook.Web.dll and we can totally get rid of Facebook.Web.Mvc.dll

Facebook subscriptions should be made as an example rather than part of the Web and Mvc.

FacebookSession and FacebookSignedRequest can be totally removed. We can rather have the following method.

var fb = new FacebookWebClient();  // new FacebookWebClient(HttpContext.Current)
dynamic signedRequest = fb.ParseSignedRequet();
string accesstoken = signedRequest.access_token;
var uid = signedRequest.uid;

Remove obsolete FacebookApp and FacebookAsyncResult (these were the old way in v4 using async callback instead of event handlers for async methods).

Remove FacebookWebAuthorizer and CanvaAuthorizer. These should be shown as samples instead or even as a seperate nuget package containing the .cs file.

Remove CanvasUrlBuilderExtensions.

Remove FacebookAppRedirectHttpHandler. This has always been causing lot of redirect loop issues and still does not correctly work when lot of users are running inside a nested folders.
I think it might be best to set the redirect_uri as just context.Request.Url instead of having a custom redirect http handler.
If we find code in the querystring we can call ExchangeCodeForAccessToken and then redirect to the same url, if we find error and error_description in the querystring, we can then show the error. But disadvantage to this is performance as we will need to parse the querystring for every request.

remove FacebookOAuthClient

Instead of having FacebookOAuthClient.ExchangeCodeForAccessToken FacebookClient should be able to handle "oauth/access_token".

GetLoginUrl should be moved to FacebookClient

GetApplicationAccessToken would be unnecessary.

add FacebookClient.ParseSignedRequest

added ParseSignedRequest to FacebookOAuthClient as virtual methods and also add TryParseSignedRequest alternatives.

[Update]
changed title from "add FacebookOAuthClient.ParseSignedRequest" to "add FacebookClient.ParseSignedRequest"

gzip

Support for gzip.

Note:

  • Silverlight does not support it.
  • Windows Phone 7.1+ (Mango supports setting the Accept type but doesn't include GZipStream class. so will need to use 3rd party libs here.)

semver in AssemblyFileVersion

update rakefile to generate the following assembly info data.

[assembly: AssemblyVersion("6.0.0")]
[assembly: AssemblyFileVersion("6.0.0-beta")]

Facebook Developers Links

Add a wiki page containing links to various useful links to the official Facebook website such as graph explorer tool, docs and so on.

add FAQ wiki page

General questions like:

  • How do I get the Facebook application access token?
  • I get "window.opener is null or not an object" when running silverlight application.

secure https url for FacebookOAuthClient.GetLoginUrl

change the following code

var url = "http://www.facebook.com/dialog/oauth/?" + FacebookUtils.ToJsonQueryString(mergedParameters);

to use secure https url instead (in FacebookOAuthClient.GetLoginUrl). Will most probably require updating unit tests too.

return original result from Query and QueryAsync methods in FQL

Here is how the query method looks like in v5. It was moved to using graph api but inorder to maintain compatibility with older versions the sdk automatically added return result["data"];

    public virtual object Query(params string[] fql)
    {
        if (fql == null)
            throw new ArgumentNullException("fql");
        if (fql.Length == 0)
            throw new ArgumentException("At least one fql query required.", "fql");

        var queryDict = new Dictionary<string, object>();

        for (int i = 0; i < fql.Length; i++)
        {
            queryDict.Add(string.Concat("query", i), fql[i]);
        }

        var parameters = new Dictionary<string, object>();
        parameters["q"] = queryDict;

        var result = (IDictionary<string, object>)Get("fql", parameters);
        return result["data"];
    }

Make it (for Query/QueryAsync methods)

   public virtual object Query(params string[] fql)
    {
        if (fql == null)
            throw new ArgumentNullException("fql");
        if (fql.Length == 0)
            throw new ArgumentException("At least one fql query required.", "fql");

        var queryDict = new Dictionary<string, object>();

        for (int i = 0; i < fql.Length; i++)
        {
            queryDict.Add(string.Concat("query", i), fql[i]);
        }

        var parameters = new Dictionary<string, object>();
        parameters["queries"] = queryDict;
        parameters["method"] = "fql.multiquery";

        return Get(parameters);
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.