C# Class FacebookSharp.Facebook

Exibir arquivo Open project: prabirshrestha/FacebookSharp Class Usage Examples

Public Properties

Property Type Description
Expires string
Token string

Protected Properties

Property Type Description
_apiBaseUrl string
_graphBaseUrl string
_oauthEndpoint string

Private Properties

Property Type Description
ExecuteGraphApiAsync void
ExecuteGraphApiAsync void
GetUsingRestApi string
GetUsingRestApi string
GetUsingRestApiAsync void
GetUsingRestApiAsync void

Public Methods

Method Description
DeleteAsync ( string graphPath, Action callback ) : void

Makes an asynchronous request to the Facebook Graph API to delete a graph object.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To delete objects in the graph, provide "/id", which will delete http://graph.facebook.com/id You can delete a like by providing /POST_ID/likes (since likes don't have an ID).

DeleteAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void

Makes an asynchronous request to the Facebook Graph API to delete a graph object.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To delete objects in the graph, provide "/id", which will delete http://graph.facebook.com/id You can delete a like by providing /POST_ID/likes (since likes don't have an ID).

ExchangeAccessTokenForCode ( string code, long &expiresIn ) : string
ExchangeAccessTokenForCode ( string code, string applicationKey, string applicationSecret, string postAuthorizeUrl, string userAgent, long &expiresIn ) : string
Facebook ( ) : System

Initializes a new instance of the Facebook class.

Facebook ( FacebookSettings facebookSettings ) : System

Initializes a new instance of the Facebook class.

Facebook ( string accessToken ) : System

Initializes a new instance of the Facebook class.

Facebook ( string accessToken, long expiresIn ) : System

Initializes a new instance of the Facebook class.

GenerateFacebookAuthorizeUrl ( string facebookApplicationKey, string redirectUri, string extendedPermissions ) : string

Returns the url to authenticate with Facebook.

GenerateFacebookLoginStatusUrl ( string>.IDictionary parameters ) : string

Returns the url to check the login status of Facebook.

GenerateFacebookLoginUrl ( string>.IDictionary parameters ) : string

Returns the url to login with Facebook.

GenerateFacebookLoginUrl ( string>.IDictionary parameters, string extendedPermissions ) : string

Returns the url to login with Facebook.

GenerateFacebookLogoutUrl ( string>.IDictionary parameters ) : string

Returns the url to logout of Facebook.

GetAsync ( string graphPath, Action callback ) : void

Make an asynchronous request to the Facebook Graph API.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me

GetAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void

Make an asynchronous request to the Facebook Graph API with the given string parameters.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me For parameters: key-value string parameters, e.g. the path "search" with parameters "q" : "facebook" would produce a query for the following graph resource: https://graph.facebook.com/search?q=facebook

GetAsync ( string graphPath, string>.IDictionary parameters, bool addAccessToken, Action callback ) : void

Make an async request to the Facebook Graph API with the given string parameters.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me For parameters: key-value string parameters, e.g. the path "search" with parameters "q" : "facebook" would produce a query for the following graph resource: https://graph.facebook.com/search?q=facebook

IsSessionValid ( ) : bool

Checks whether this object has an non-expired session token.

PostAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void

Publish to the Facebook Graph API.

See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To post to the wall of the currently logged authenticated user, provide "/me/feed", which will make a request to http://graph.facebook.com/me/feed For parameters: key-value string parameters, e.g. parameters "message" : "this is a message" would produce the follwing parameters message=this is a message

SetAccessExpiresIn ( string expiresIn ) : void

Set the current session's duration (in seconds since Unix epoch).

Private Methods

Method Description
ExecuteGraphApiAsync ( Method httpMethod, string graphPath, string>.IDictionary parameters, bool addAccessToken, Action callback ) : void
ExecuteGraphApiAsync ( RestRequest request, bool addAccessToken, string userAgent, Action callback ) : void
GetUsingRestApi ( string methodName, string>.IDictionary parameters ) : string
GetUsingRestApi ( string methodName, string>.IDictionary parameters, bool addAccessToken ) : string
GetUsingRestApiAsync ( string methodName, string>.IDictionary parameters, Action callback ) : void
GetUsingRestApiAsync ( string methodName, string>.IDictionary parameters, bool addAccessToken, Action callback ) : void

Method Details

DeleteAsync() public method

Makes an asynchronous request to the Facebook Graph API to delete a graph object.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To delete objects in the graph, provide "/id", which will delete http://graph.facebook.com/id You can delete a like by providing /POST_ID/likes (since likes don't have an ID).
public DeleteAsync ( string graphPath, Action callback ) : void
graphPath string /// Path to the resource in the Facebook graph. ///
callback Action /// The callback. ///
return void

DeleteAsync() public method

Makes an asynchronous request to the Facebook Graph API to delete a graph object.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To delete objects in the graph, provide "/id", which will delete http://graph.facebook.com/id You can delete a like by providing /POST_ID/likes (since likes don't have an ID).
public DeleteAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void
graphPath string /// Path to the resource in the Facebook graph. ///
parameters string>.IDictionary /// key-value string parameters. ///
callback Action /// The callback. ///
return void

ExchangeAccessTokenForCode() public method

public ExchangeAccessTokenForCode ( string code, long &expiresIn ) : string
code string
expiresIn long
return string

ExchangeAccessTokenForCode() public static method

public static ExchangeAccessTokenForCode ( string code, string applicationKey, string applicationSecret, string postAuthorizeUrl, string userAgent, long &expiresIn ) : string
code string
applicationKey string
applicationSecret string
postAuthorizeUrl string
userAgent string
expiresIn long
return string

Facebook() public method

Initializes a new instance of the Facebook class.
public Facebook ( ) : System
return System

Facebook() public method

Initializes a new instance of the Facebook class.
public Facebook ( FacebookSettings facebookSettings ) : System
facebookSettings FacebookSettings /// The facebook settings. ///
return System

Facebook() public method

Initializes a new instance of the Facebook class.
public Facebook ( string accessToken ) : System
accessToken string /// The access token. ///
return System

Facebook() public method

Initializes a new instance of the Facebook class.
public Facebook ( string accessToken, long expiresIn ) : System
accessToken string /// The access token. ///
expiresIn long /// The expires in. ///
return System

GenerateFacebookAuthorizeUrl() public static method

Returns the url to authenticate with Facebook.
public static GenerateFacebookAuthorizeUrl ( string facebookApplicationKey, string redirectUri, string extendedPermissions ) : string
facebookApplicationKey string
redirectUri string
extendedPermissions string
return string

GenerateFacebookLoginStatusUrl() public static method

Returns the url to check the login status of Facebook.
public static GenerateFacebookLoginStatusUrl ( string>.IDictionary parameters ) : string
parameters string>.IDictionary
return string

GenerateFacebookLoginUrl() public static method

Returns the url to login with Facebook.
public static GenerateFacebookLoginUrl ( string>.IDictionary parameters ) : string
parameters string>.IDictionary
return string

GenerateFacebookLoginUrl() public static method

Returns the url to login with Facebook.
public static GenerateFacebookLoginUrl ( string>.IDictionary parameters, string extendedPermissions ) : string
parameters string>.IDictionary
extendedPermissions string
return string

GenerateFacebookLogoutUrl() public static method

Returns the url to logout of Facebook.
public static GenerateFacebookLogoutUrl ( string>.IDictionary parameters ) : string
parameters string>.IDictionary
return string

GetAsync() public method

Make an asynchronous request to the Facebook Graph API.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me
public GetAsync ( string graphPath, Action callback ) : void
graphPath string /// Path to the resource in the Facebook graph. ///
callback Action /// The callback. ///
return void

GetAsync() public method

Make an asynchronous request to the Facebook Graph API with the given string parameters.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me For parameters: key-value string parameters, e.g. the path "search" with parameters "q" : "facebook" would produce a query for the following graph resource: https://graph.facebook.com/search?q=facebook
public GetAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void
graphPath string /// Path to the resource in the Facebook graph. ///
parameters string>.IDictionary /// key-value string parameters. ///
callback Action /// The callback. ///
return void

GetAsync() public method

Make an async request to the Facebook Graph API with the given string parameters.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To fetch data about the currently logged authenticated user, provide "/me", which will fetch http://graph.facebook.com/me For parameters: key-value string parameters, e.g. the path "search" with parameters "q" : "facebook" would produce a query for the following graph resource: https://graph.facebook.com/search?q=facebook
public GetAsync ( string graphPath, string>.IDictionary parameters, bool addAccessToken, Action callback ) : void
graphPath string Path to the resource in the Facebook graph.
parameters string>.IDictionary key-value string parameters.
addAccessToken bool Add whether to set the access token or not.
callback Action /// The callback. ///
return void

IsSessionValid() public method

Checks whether this object has an non-expired session token.
public IsSessionValid ( ) : bool
return bool

PostAsync() public method

Publish to the Facebook Graph API.
See http://developers.facebook.com/docs/api Note that this method is asynchronous. This method will not block waiting for a network response. To post to the wall of the currently logged authenticated user, provide "/me/feed", which will make a request to http://graph.facebook.com/me/feed For parameters: key-value string parameters, e.g. parameters "message" : "this is a message" would produce the follwing parameters message=this is a message
public PostAsync ( string graphPath, string>.IDictionary parameters, Action callback ) : void
graphPath string /// Path to the resource in the Facebook graph. ///
parameters string>.IDictionary /// key-value string parameters. ///
callback Action /// The callback. ///
return void

SetAccessExpiresIn() public method

Set the current session's duration (in seconds since Unix epoch).
public SetAccessExpiresIn ( string expiresIn ) : void
expiresIn string Duration in seconds.
return void

Property Details

Expires public_oe static_oe property

public static string Expires
return string

Token public_oe static_oe property

public static string Token
return string

_apiBaseUrl protected_oe static_oe property

protected static string _apiBaseUrl
return string

_graphBaseUrl protected_oe static_oe property

protected static string _graphBaseUrl
return string

_oauthEndpoint protected_oe static_oe property

protected static string _oauthEndpoint
return string