C# Class Facebook.FacebookOAuthClient

Represents the Facebook OAuth Helpers
ファイルを表示 Open project: anujb/MonoMobile.Facebook Class Usage Examples

Private Properties

Property Type Description
BuildApplicationAccessTokenParameters object>.IDictionary
BuildApplicationAccessTokenResult object
BuildExchangeCodeForAccessTokenParameters object>.IDictionary
BuildExchangeCodeForAccessTokenResult object
DownloadDataCompleted void
GetApiEventArgs Facebook.FacebookApiEventArgs

Public Methods

Method Description
ExchangeCodeForAccessToken ( string code ) : object

Exchange code for access token.

ExchangeCodeForAccessToken ( string code, object>.IDictionary parameters ) : object

Exchange code for access token.

ExchangeCodeForAccessTokenAsync ( string code ) : void

Exchange code for access token asynchronously.

ExchangeCodeForAccessTokenAsync ( string code, object>.IDictionary parameters ) : void

Exchange code for access token asynchronously.

ExchangeCodeForAccessTokenAsync ( string code, object>.IDictionary parameters, object userToken ) : void

Exchange code for access token asynchronously.

FacebookOAuthClient ( ) : System

Initializes a new instance of the FacebookOAuthClient class.

FacebookOAuthClient ( IFacebookApplication facebookApplication ) : System

Initializes a new instance of the FacebookOAuthClient class.

GetApplicationAccessToken ( ) : object

Gets the application access token.

GetApplicationAccessToken ( object>.IDictionary parameters ) : object

Gets the application access token.

GetApplicationAccessTokenAsync ( ) : void

Gets the application access token asynchronously.

GetApplicationAccessTokenAsync ( object>.IDictionary parameters, object userToken ) : void

Gets the application access token asynchronously.

GetApplicationAccessTokenAsync ( object userToken ) : void

Gets the application access token asynchronously.

GetLoginUrl ( ) : Uri

Gets the login uri.

GetLoginUrl ( object>.IDictionary parameters ) : Uri

Gets the login uri.

http://developers.facebook.com/docs/reference/dialogs/oauth Parameters that can be used: client_id : Your application's identifier. This is called client_id instead of app_id for this particular method to be compliant with the OAuth 2.0 specification. Required, but automatically specified by most SDKs. redirect_uri : The URL to redirect to after the user clicks a button on the dialog. Required, but automatically specified by most SDKs. scope : Optional. A comma-delimited list of permissions. state : Optional. An opaque string used to maintain application state between the request and callback. When Facebook redirects the user back to your redirect_uri, this value will be included unchanged in the response. response_type : Optional, default is token. The requested response: an access token (token), an authorization code (code), or both (code_and_token). display : The display mode in which to render the dialog. The default is page on the www subdomain and wap on the m subdomain. This is automatically specified by most SDKs. (For WP7 builds it is set to touch.)

GetLoginUrl ( string appId, Uri redirectUri ) : Uri

Gets the login url.

GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions ) : Uri

Gets the login url.

GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions, object>.IDictionary loginParameters ) : Uri

Gets the login url.

GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions, bool logout, object>.IDictionary loginParameters ) : Uri

Gets the login url.

GetLogoutUrl ( ) : Uri

Gets the logout url.

GetLogoutUrl ( object>.IDictionary parameters ) : Uri

Gets the logout url.

Protected Methods

Method Description
GetUrl ( string name, string path, object>.IDictionary parameters ) : Uri

Build the URL for given domain alias, path and parameters.

OAuthRequest ( string name, string path, object>.IDictionary parameters ) : string
OAuthRequestAsync ( string name, string path, object>.IDictionary parameters, object userToken, string>.Func processResponseString, FacebookApiEventArgs>.Action onDownloadComplete ) : void

Private Methods

Method Description
BuildApplicationAccessTokenParameters ( object>.IDictionary parameters, string &name, string &path ) : object>.IDictionary
BuildApplicationAccessTokenResult ( string responseString ) : object
BuildExchangeCodeForAccessTokenParameters ( object>.IDictionary parameters, string &name, string &path ) : object>.IDictionary
BuildExchangeCodeForAccessTokenResult ( string json ) : object
DownloadDataCompleted ( object sender, DownloadDataCompletedEventArgsWrapper e, string>.Func processResponseString, FacebookApiEventArgs>.Action onDownloadComplete ) : void
GetApiEventArgs ( AsyncCompletedEventArgs e, string json, Facebook.HttpMethod &httpMethod ) : Facebook.FacebookApiEventArgs

Method Details

ExchangeCodeForAccessToken() public method

Exchange code for access token.
public ExchangeCodeForAccessToken ( string code ) : object
code string /// The code. ///
return object

ExchangeCodeForAccessToken() public method

Exchange code for access token.
public ExchangeCodeForAccessToken ( string code, object>.IDictionary parameters ) : object
code string /// The code. ///
parameters object>.IDictionary /// The parameters. ///
return object

ExchangeCodeForAccessTokenAsync() public method

Exchange code for access token asynchronously.
public ExchangeCodeForAccessTokenAsync ( string code ) : void
code string /// The code. ///
return void

ExchangeCodeForAccessTokenAsync() public method

Exchange code for access token asynchronously.
public ExchangeCodeForAccessTokenAsync ( string code, object>.IDictionary parameters ) : void
code string /// The code. ///
parameters object>.IDictionary /// The parameters. ///
return void

ExchangeCodeForAccessTokenAsync() public method

Exchange code for access token asynchronously.
public ExchangeCodeForAccessTokenAsync ( string code, object>.IDictionary parameters, object userToken ) : void
code string /// The code. ///
parameters object>.IDictionary /// The parameters. ///
userToken object /// The user token. ///
return void

FacebookOAuthClient() public method

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

FacebookOAuthClient() public method

Initializes a new instance of the FacebookOAuthClient class.
public FacebookOAuthClient ( IFacebookApplication facebookApplication ) : System
facebookApplication IFacebookApplication /// The facebook application. ///
return System

GetApplicationAccessToken() public method

Gets the application access token.
public GetApplicationAccessToken ( ) : object
return object

GetApplicationAccessToken() public method

Gets the application access token.
public GetApplicationAccessToken ( object>.IDictionary parameters ) : object
parameters object>.IDictionary /// The parameters. ///
return object

GetApplicationAccessTokenAsync() public method

Gets the application access token asynchronously.
public GetApplicationAccessTokenAsync ( ) : void
return void

GetApplicationAccessTokenAsync() public method

Gets the application access token asynchronously.
public GetApplicationAccessTokenAsync ( object>.IDictionary parameters, object userToken ) : void
parameters object>.IDictionary /// The parameters. ///
userToken object /// The user token. ///
return void

GetApplicationAccessTokenAsync() public method

Gets the application access token asynchronously.
public GetApplicationAccessTokenAsync ( object userToken ) : void
userToken object /// The user token. ///
return void

GetLoginUrl() public method

Gets the login uri.
public GetLoginUrl ( ) : Uri
return System.Uri

GetLoginUrl() public method

Gets the login uri.
http://developers.facebook.com/docs/reference/dialogs/oauth Parameters that can be used: client_id : Your application's identifier. This is called client_id instead of app_id for this particular method to be compliant with the OAuth 2.0 specification. Required, but automatically specified by most SDKs. redirect_uri : The URL to redirect to after the user clicks a button on the dialog. Required, but automatically specified by most SDKs. scope : Optional. A comma-delimited list of permissions. state : Optional. An opaque string used to maintain application state between the request and callback. When Facebook redirects the user back to your redirect_uri, this value will be included unchanged in the response. response_type : Optional, default is token. The requested response: an access token (token), an authorization code (code), or both (code_and_token). display : The display mode in which to render the dialog. The default is page on the www subdomain and wap on the m subdomain. This is automatically specified by most SDKs. (For WP7 builds it is set to touch.)
public GetLoginUrl ( object>.IDictionary parameters ) : Uri
parameters object>.IDictionary /// The parameters. ///
return System.Uri

GetLoginUrl() public static method

Gets the login url.
public static GetLoginUrl ( string appId, Uri redirectUri ) : Uri
appId string /// The app id. ///
redirectUri System.Uri /// The redirect Uri. ///
return System.Uri

GetLoginUrl() public static method

Gets the login url.
public static GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions ) : Uri
appId string /// The app id. ///
redirectUri System.Uri /// The redirect Uri. ///
extendedPermissions string /// The extended permissions (scope). ///
return System.Uri

GetLoginUrl() public static method

Gets the login url.
public static GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions, object>.IDictionary loginParameters ) : Uri
appId string /// The app id. ///
redirectUri System.Uri /// The redirect Uri. ///
extendedPermissions string /// The extended permissions (scope). ///
loginParameters object>.IDictionary /// The login parameters. ///
return System.Uri

GetLoginUrl() public static method

Gets the login url.
public static GetLoginUrl ( string appId, Uri redirectUri, string extendedPermissions, bool logout, object>.IDictionary loginParameters ) : Uri
appId string /// The app id. ///
redirectUri System.Uri /// The redirect Uri. ///
extendedPermissions string /// The extended permissions (scope). ///
logout bool /// Indicates whether to logout existing logged in user or not. ///
loginParameters object>.IDictionary /// The login parameters. ///
return System.Uri

GetLogoutUrl() public method

Gets the logout url.
public GetLogoutUrl ( ) : Uri
return System.Uri

GetLogoutUrl() public method

Gets the logout url.
public GetLogoutUrl ( object>.IDictionary parameters ) : Uri
parameters object>.IDictionary /// The parameters. ///
return System.Uri

GetUrl() protected method

Build the URL for given domain alias, path and parameters.
protected GetUrl ( string name, string path, object>.IDictionary parameters ) : Uri
name string /// The name of the domain (from the domain maps). ///
path string /// Optional path (without a leading slash) ///
parameters object>.IDictionary /// Optional query parameters ///
return System.Uri

OAuthRequest() protected method

protected OAuthRequest ( string name, string path, object>.IDictionary parameters ) : string
name string
path string
parameters object>.IDictionary
return string

OAuthRequestAsync() protected method

protected OAuthRequestAsync ( string name, string path, object>.IDictionary parameters, object userToken, string>.Func processResponseString, FacebookApiEventArgs>.Action onDownloadComplete ) : void
name string
path string
parameters object>.IDictionary
userToken object
processResponseString string>.Func
onDownloadComplete FacebookApiEventArgs>.Action
return void