togethersocialfacebook - TogetherGames/Public-Corona-Lua GitHub Wiki
Together::TogetherSocialFacebook
The TogetherSocialFacebook class handles all Facebook related operations.
string FacebookAppID
The ID of the Facebook Application that is passed into the facebook.login() function.
table FacebookPrivileges
The privileges to request from facebook whenever the User logs in.
FriendManager FriendManager
The FriendManager also accessible from g_Together.FriendManager
table FacebookFriends
A table of external Facebook friends
table FacebookFriendsDictionaryBySocialID
A table of external Facebook friends where each key is a Friend's FacebookID
boolean FacebookFriendsRetrieved
A boolean indicating whether Facebook friends have been retrieved during this session
Initializes the instance so it can connect to Facebook.
Returns void
TogetherSocialFacebook:Initialize( facebookAppID, facebookPrivileges )
string facebookAppID
The Facebook Application ID to authenticate with
[table](#) facebookPrivilegesThe privileges to authenticate with
--------------------------------------------------------------------------------Gets the number of FacebookFriends currently managed internally.
Returns number
TogetherSocialFacebook:GetFacebookFriendCount( )
Finds the Facebook friend at the specified index.
Returns TogetherExternalFriend
TogetherSocialFacebook:GetFacebookFriend( index )
number index
The index of the friend to find
--------------------------------------------------------------------------------Finds the Facebook friend by their Facebook ID.
Returns ExternalFriend
TogetherSocialFacebook:FindBySocialID( socialID )
string socialID
The index of the FacebookFriend to find if it exists, otherwise returns nil
--------------------------------------------------------------------------------Attempts to log into Facebook. After successfully connecting, this will also register the user with their profile information. If this user has already registered through Facebook before, the accounts will be merged. Additionally, their Facebook friends list will be retrieved and synchronized to their Together friends list.
Returns void
TogetherSocialFacebook:Login( togetherFacebookUser, callbackFunc )
TogetherFacebookUser togetherFacebookUser
An instance of a FacebookUser object that gets filled in with their Facebook information.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Attempts to log the user out of Facebook if connected
Returns void
TogetherSocialFacebook:Logout( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Submits a wall post to the active user's wall
Note
This method does not display a dialog box
Returns void
TogetherSocialFacebook:SendPost( postName, postDescription, postMessage, postPictureLink, postCaption, callbackFunc )
string postName
The name/title of the wall post
[string](#) postDescriptionThe description of the wall post
[string](#) postMessageA message for the wall post
[string](#) postPictureLinkA media link for the wall post
[string](#) postCaptionThe caption for the wall post
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Submits a wall post to a User's wall
Note
This method will attempt to display a Facebook dialog
Returns void
TogetherSocialFacebook:SendPostToUser( who, postName, postDescription, postMessage, postPictureLink, postCaption, callbackFunc )
ExternalFriend who
The receiver of the wall post must be a friend
[string](#) postNameA name/title for the wall post
[string](#) postDescriptionThe description of the wall post
[string](#) postMessageA message for the wall post
[string](#) postPictureLinkA media link for the wall post
[string](#) postCaptionThe caption for the wall post
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Retrieves your Facebook friends list and synchronizes it with your Together friends list
Returns void
TogetherSocialFacebook:GetFriends( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------