My Project  0.10.0
Windows SDK for Facebook
Public Member Functions | Properties | List of all members
winsdkfb::FBSession Class Reference

#include <FacebookSession.h>

Public Member Functions

Windows::Foundation::IAsyncAction^ LogoutAsync ()
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ ShowFeedDialogAsync (Windows::Foundation::Collections::PropertySet^ Parameters)
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ ShowRequestsDialogAsync (Windows::Foundation::Collections::PropertySet^ Parameters)
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ ShowSendDialogAsync (Windows::Foundation::Collections::PropertySet^ Parameters)
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ LoginAsync ()
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ LoginAsync (winsdkfb::FBPermissions^ Permissions)
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ LoginAsync (winsdkfb::FBPermissions^ Permissions, SessionLoginBehavior behavior)
 
void SetAPIVersion (int MajorVersion, int MinorVersion)
 
void SetWebViewRedirectUrl (Platform::String^ domain, Platform::String^ path)
 
Windows::Foundation::IAsyncOperation< FBResult^ >^ TryRefreshAccessToken ()
 

Properties

Platform::String^  FBAppId [get, set]
 
Platform::String^  WinAppId [get, set]
 
Platform::String^  AppResponse [get]
 Response from FB App.
 
bool LoggedIn [get]
 Returns whether session (user) is logged in.
 
winsdkfb::FBAccessTokenData^  AccessTokenData [get, set]
 
int APIMajorVersion [get]
 
int APIMinorVersion [get]
 
winsdkfb::Graph::FBUser^  User [get]
 User info - valid after successful login.
 
Platform::String^  WebViewRedirectDomain [get]
 
Platform::String^  WebViewRedirectPath [get]
 
static FBSession^  ActiveSession [get]
 
static Windows::Storage::ApplicationDataContainer^  DataContainer [get]
 

Detailed Description

The main object for the SDK, repository for access token, etc. FBSession is a singleton class that is used to configure the sdk's interaction with Facebook.

Member Function Documentation

IAsyncOperation< FBResult^ > FBSession::LoginAsync ( )

Login to Facebook. This method defaults to SessionLoginBehavior::DefaultOrdering for its login method. The permissions requested are public_profile, email, user_friends.

Returns
FBResult indicating the result of the Login attempt.
IAsyncOperation< FBResult^ > FBSession::LoginAsync ( winsdkfb::FBPermissions Permissions)

Login to Facebook. This method defaults to SessionLoginBehavior::DefaultOrdering for its login method.

Parameters
PermissionsThe Facebook permissions that the app is requesting.
Returns
FBResult indicating the result of the Login attempt.
IAsyncOperation< FBResult^ > FBSession::LoginAsync ( winsdkfb::FBPermissions Permissions,
SessionLoginBehavior  behavior 
)

Login to Facebook. This method allows the login method to be specified.

Parameters
PermissionsThe Facebook permissions that the app is requesting.
behaviorThe login behavior to make the login attempt with.
Returns
FBResult indicating the result of the Login attempt.
IAsyncAction FBSession::LogoutAsync ( )

Clear all login information, e.g. user info, token string, etc. Do note that this does not clear cookies.

void FBSession::SetAPIVersion ( int  MajorVersion,
int  MinorVersion 
)

Sets the Facebook API version that is specified with most API calls to Facebook.

Parameters
MajorVersionvalue for API major version.
MinorVersionvalue for API minor version.
void FBSession::SetWebViewRedirectUrl ( Platform::String^  domain,
Platform::String^  path 
)

Sets the redirect URL for webview dialog requests. Note that either parameter can be set to nullptr to avoid changing the default.

Parameters
domainThe domain name for the the redirect. Must include the protocol (e.g. https)
pathThe path of redirect. Must start with the '/' character.
IAsyncOperation< FBResult^ > FBSession::ShowFeedDialogAsync ( Windows::Foundation::Collections::PropertySet^  Parameters)

Launch 'feed' dialog, to post to user's timeline.

Parameters
ParametersThe collection of parameters used by the feed dialog. See https://developers.facebook.com/docs/sharing/reference/feed-dialog For more information.
Returns
FBResult indicating the result of the dialog flow.
IAsyncOperation< FBResult^ > FBSession::ShowRequestsDialogAsync ( Windows::Foundation::Collections::PropertySet^  Parameters)

Launch 'request' dialog, to send app requests to user's Facebook friends.

Parameters
ParametersThe collection of parameters used by the request dialog, the most notable being "message".
Returns
FBResult indicating the result of the dialog flow.
IAsyncOperation< FBResult^ > FBSession::ShowSendDialogAsync ( Windows::Foundation::Collections::PropertySet^  Parameters)

Launch 'send' dialog, to send private message to user's friends.

Parameters
ParametersThe collection of parameters used by the send dialog. See https://developers.facebook.com/docs/sharing/reference/send-dialog for more information.
Returns
FBResult indicating the result of the dialog flow.

Property Documentation

winsdkfb:: FBAccessTokenData^ winsdkfb::FBSession::AccessTokenData
getset

Access token data, only populated after LoginAsync() has been called.

FBSession^ winsdkfb::FBSession::ActiveSession
staticget

FBSession is a singleton object - ActiveSession is the way to acquire a reference to the object.

int winsdkfb::FBSession::APIMajorVersion
get

The Facebook API major version that is specified with most http requests to Facebook. Defaults to 2. Can be changed with SetAPIVersion().

int winsdkfb::FBSession::APIMinorVersion
get

The Facebook API minor version that is specified with most http requests to Facebook. Defaults to 1. Can be changed with SetAPIVersion().

Windows:: Storage:: ApplicationDataContainer^ winsdkfb::FBSession::DataContainer
staticget

Get the Settings Container for the SDK

Returns
ApplicationDataContainer
Platform:: String^ winsdkfb::FBSession::FBAppId
getset

Facebook App ID that is provided by Facebook in their developer portal.

Platform:: String^ winsdkfb::FBSession::WebViewRedirectDomain
get

Base domain to redirect to for webview dialog requests. Defaults to Facebook's website.

Platform:: String^ winsdkfb::FBSession::WebViewRedirectPath
get

Redirect path for webview dialogs requests. Defaults to /connect/login_success.html. Must start with a '/' character.

Platform:: String^ winsdkfb::FBSession::WinAppId
getset

Windows App ID, must match the appliction's SID and the Windows Store SID field in the Facebook developer page for the app.


The documentation for this class was generated from the following files: