friendmanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.FriendManager
The FriendManager class contains a collection of Friends.
table Friends
Stores all the Friends contained in the Manager.
table FriendsDictionaryByUserID
A table used to store all together friends in a dictionary form by their UserID.
table FriendsDictionaryBySocialID
A table used to store all together friends in a dictionary form by their SocialID.
Adds a TogetherFriend to the manager internally without persistence.
Note
This method is deprecated
Returns void
FriendManager:Add( friend )
TogetherFriend friend
Instance of the TogetherFriend to add
--------------------------------------------------------------------------------Finds a TogetherFriend by UserID if it exists, otherwise returns nil.
Returns TogetherFriend
FriendManager:FindByUserID( userID )
number userID
The ID of the User to find
--------------------------------------------------------------------------------Finds the TogetherFriend by SocialID if it exists, otherwise returns nil.
Returns TogetherFriend
FriendManager:FindBySocialID( socialID )
number socialID
The SocialID of the User to find
--------------------------------------------------------------------------------Gets the number of TogetherFriends currently managed internally.
Returns number
FriendManager:GetCount( )
Gets the TogetherFriend at the specified index if it exists, otherwise returns nil.
Returns TogetherFriend
FriendManager:Get( index )
number index
The index of the Friend to find
--------------------------------------------------------------------------------Gets the Index of the specified Friend if it exists, otherwise returns nil.
Returns number
FriendManager:IndexOf( friend )
TogetherFriend friend
Instance of the Friend to get the index of
--------------------------------------------------------------------------------Returns the index of the TogetherFriend with the specified UserID if it exists, otherwise returns -1.
Returns number
FriendManager:IndexOfByUserID( userID )
number userID
The ID of the User to get the index of
--------------------------------------------------------------------------------Removes a TogetherFriend from the internally managed list. This does not delete the Friend from the user's list persistently.
Note
This method is deprecated
Returns void
FriendManager:Remove( index )
number index
The index of the FriendUse to be removed internally
--------------------------------------------------------------------------------Adds a new friend to the current session's User account. Upon success, this will automatically update the internal list.
Returns void
FriendManager:AddFriend( friendUserID, callbackFunc )
number friendUserID
The ID of the User to add as a friend
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Gets all Friends from the current session's User account. Upon success, this will automatically update the internal list.
Returns void
FriendManager:GetAll( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Removes a Friend from the current session's User account. Upon success, this will automatically update the internal list.
Returns void
FriendManager:RemoveFriend( friendUserID, callbackFunc )
number friendUserID
The ID of a User to remove as a friend
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Synchronizes the Friend list. This method is called whenever you initially log into Facebook. For each Facebook friend, if they are also a registered Together User, they become a Together friend on the User account. Upon success, this will automatically update the internal list.
Returns void
FriendManager:SynchFriends( The, externalFriends, callbackFunc )
string The
type of synchronization to be done. Pass "FB" for Facebook. This parameter exists for future expandability to other social networks.
[table](#) externalFriendsThe array full of external (Facebook) friends.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------