usernotificationmanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.UserNotificationManager
The UserNotificationManager class contains a collection UserNotifications. With this class, a developer will be able to Create, Delete, Retrieve All, and Process UserNotifications.
table UserNotifications
Stores all the UserNotifications contained in the Manager.
Adds a UserNotification to the internally managed list without persistence.
Note
This method is deprecated
Returns void
UserNotificationManager:Add( userNotification )
TogetherUserNotification userNotification
Instance of a UserNotification to add internally
--------------------------------------------------------------------------------Finds the UserNotification with the specified UserNotificationID if it exists, otherwise returns nil.
Returns TogetherUserNotification
UserNotificationManager:FindByUserNotificationID( userNotificationID )
number userNotificationID
The ID of the UserNotification to find
--------------------------------------------------------------------------------Gets the number of UserNotifications currently managed internally.
Returns number
UserNotificationManager:GetCount( )
Gets the UserNotification at the specified index if it exists, otherwise returns nil.
Returns TogetherUserNotification
UserNotificationManager:Get( index )
number index
The index of the UserNotification to find
--------------------------------------------------------------------------------Returns the index of the specified UserNotification if it exists, otherwise returns nil.
Returns number
UserNotificationManager:IndexOf( userNotification )
TogetherUserNotification userNotification
Instance of the UserNotification to find the index of
--------------------------------------------------------------------------------Returns the index of the UserNotification with the specified UserNotificationID if it exists, otherwise returns -1.
Returns number
UserNotificationManager:IndexOfByUserNotificationID( userNotificationID )
number userNotificationID
The ID of the UserNotification to find the index of
--------------------------------------------------------------------------------Removes a UserNotification from the internally managed list. This does not delete the notification from the user's account persistently.
Note
This method is deprecated
Returns void
UserNotificationManager:Remove( index )
number index
The index of the UserNotification to remove internally
--------------------------------------------------------------------------------Creates a new UserNotification. Upon success, this will automatically update the internal list.
Returns void
UserNotificationManager:Create( destUserID, type, message, originalGameInstanceID, gameInstanceID, achievementID, chatRoomID, itemID, itemCount, socialType, socialID, callbackFunc )
number destUserID
The ID of the User to send the UserNotification to.
[string](#) typeThe type of UserNotification being created.
[string](#) messageThe message of the UserNotification.
[number](#) originalGameInstanceIDThe original GameInstanceID played before creating a rematch. Pass in 0 if this UserNotification does not pertain to a rematch.
[number](#) gameInstanceIDThe ID of the GameInstance assigned to the UserNotification.
[number](#) achievementIDThe ID of the Achievement assigned to the UserNotification.
[number](#) chatRoomIDThe ID of the ChatRoom assigned to the UserNotification.
[number](#) itemIDThe ID of the Item assigned to the UserNotification.
[number](#) itemCountThe number of Items assigned to the UserNotification.
[string](#) socialTypeThe type of social network which caused the UserNotification to be created. Pass in "FB" for Facebook. Pass in "" if not specified.
[string](#) socialIDThe ID of the user on a social network. Pass in the user's FacebookID for Facebook. Pass in "0" if not specified.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Deletes a UserNotification. Upon success, this will automatically update the internal list.
Returns void
UserNotificationManager:Delete( userNotificationID, callbackFunc )
number userNotificationID
The ID of the UserNotification to delete
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Gets all UserNotifications for the User. Upon success, this will automatically update the internal list.
Returns void
UserNotificationManager:GetAll( processed, callbackFunc )
boolean processed
A boolean indicating whether processed or unprocessed UserNotifications should be retrieved
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Processes a UserNotification. Upon success, this will automatically update the internal list.
Returns void
UserNotificationManager:Process( userNotificationID, accepted, callbackFunc )
number userNotificationID
The ID of the UserNotification that is to be processed.
[boolean](#) acceptedA boolean indicated whether the UserNotfication was accepted. Users must accept UserNotifications in order to create/join a rematch GameInstance or be awarded Achievements or Items.
[function](#) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------