usermessagemanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.UserMessageManager
The UserMessageManager class is used to find and fetch messages directly sent to the current session's User account. With this class, a developer will be able to create a message, delete a message, get all messages, and mark a message as read. A Developer can use UserMessages as in-game email.
table UserMessages
Stores all the UserMessages contained in the Manager.
Adds a UserMessage to the internally managed list without persistence.
Note
This method is deprecated
Returns void
UserMessageManager:Add( userMessage )
TogetherUserMessage userMessage
Instance of a UserMessage to add internally
--------------------------------------------------------------------------------Finds the UserMessage with the specified UserMessageID if it exists, otherwise returns nil.
Returns TogetherUserMessage
UserMessageManager:FindByUserMessageID( userMessageID )
number userMessageID
The ID of the UserMessage to find
--------------------------------------------------------------------------------Gets the number of UserMessages currently managed internally.
Returns number
UserMessageManager:GetCount( )
Gets the UserMessage at the specified index if it exists, otherwise returns nil.
Returns TogetherUserMessage
UserMessageManager:Get( index )
number index
The index of the UserMessage to find
--------------------------------------------------------------------------------Returns the index of the specified UserMessage if it exists, otherwise returns nil.
Returns number
UserMessageManager:IndexOf( userMessage )
TogetherUserMessage userMessage
Instance of the UserMessage to find the index of
--------------------------------------------------------------------------------Returns the index of the UserMessage with the specified UserMessageID if it exists, otherwise returns -1.
Returns number
UserMessageManager:IndexOfByUserMessageID( userMessageID )
number userMessageID
The ID of the UserMessage to find the index of
--------------------------------------------------------------------------------Removes a UserMessage from the internally managed list. This does not delete the message from the user's mailbox persistently.
Note
This method is deprecated
Returns void
UserMessageManager:Remove( index )
number index
The index of the UserMessage to remove internally
--------------------------------------------------------------------------------Gets all UserMessages assigned to the User. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager:GetAll( unreadOnly, startID, count, callbackFunc )
boolean unreadOnly
A Boolean indicating whether only unread messages should be retrieved.
[number](#) startIDThe ID of the UserMessage to start with when returning UserMessages.
[number](#) countThe max number of UserMessages to return.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Sends a message to a specific User. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager:CreateMessage( destinationUserID, title, message, isGameIndependent, messageProperties, callbackFunc )
number destinationUserID
The ID of the User to send the UserMessage to.
[string](#) titleThe title of the UserMessage.
[string](#) messageThe message of the UserMessage.
[boolean](#) isGameIndependentA boolean indicating whether the generated UserMessage is assigned to the Game being played.
[PropertyCollection](./propertycollection) messagePropertiesThe properties to assign to the UserMessage. Pass in nil to assign no properties.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Marks a UserMessage as read. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager:MarkMessageAsRead( userMessageID, callbackFunc )
number userMessageID
The ID of the UserMessage to mark as read.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Deletes a UserMessage. Upon success, this will automatically update the internal mailbox.
Returns void
UserMessageManager:DeleteMessage( userMessageID, callbackFunc )
number userMessageID
The ID of the UserMessage to delete.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------