usernotificationmanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

UserNotificationManager

together.UserNotificationManager

Overview

The UserNotificationManager class contains a collection UserNotifications. With this class, a developer will be able to Create, Delete, Retrieve All, and Process UserNotifications.


Members

List<UserNotification> UserNotifications

Stores all the UserNotifications contained in the Manager.


Methods


Add()

Adds a UserNotification to the internally managed list without persistence.

Note
This method is deprecated

Returns void
Syntax
UserNotificationManager.Add( userNotification )
Parameters

UserNotification userNotification

Instance of a UserNotification to add internally

--------------------------------------------------------------------------------

FindByUserNotificationID()

Finds the UserNotification with the specified UserNotificationID if it exists, otherwise returns null.

Syntax
UserNotificationManager.FindByUserNotificationID( userNotificationID )
Parameters

long userNotificationID

The ID of the UserNotification to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of UserNotifications currently managed internally.

Returns int
Syntax
UserNotificationManager.GetCount(  )

Get()

Gets the UserNotification at the specified index if it exists, otherwise returns null.

Syntax
UserNotificationManager.Get( index )
Parameters

int index

The index of the UserNotification to find

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified UserNotification if it exists, otherwise returns -1.

Returns int
Syntax
UserNotificationManager.IndexOf( userNotification )
Parameters

UserNotification userNotification

Instance of the UserNotification to find the index of

--------------------------------------------------------------------------------

IndexOfByUserNotificationID()

Returns the index of the UserNotification with the specified UserNotificationID if it exists, otherwise returns -1.

Returns int
Syntax
UserNotificationManager.IndexOfByUserNotificationID( userNotificationID )
Parameters

long userNotificationID

The ID of the UserNotification to find the index of

--------------------------------------------------------------------------------

Remove()

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
Syntax
UserNotificationManager.Remove( index )
Parameters

int index

The index of the UserNotification to remove internally

--------------------------------------------------------------------------------

Create()

Creates a new UserNotification. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserNotificationManager.Create( destUserID, type, message, originalGameInstanceID, gameInstanceID, achievementID, chatRoomID, itemID, itemCount, socialType, socialID, callbackFunc )
Parameters

long destUserID

The ID of the User to send the UserNotification to.

[string](#) type

The type of UserNotification being created.

[string](#) message

The message of the UserNotification.

[long](#) originalGameInstanceID

The original GameInstanceID played before creating a rematch. Pass in 0 if this UserNotification does not pertain to a rematch.

[long](#) gameInstanceID

The ID of the GameInstance assigned to the UserNotification.

[long](#) achievementID

The ID of the Achievement assigned to the UserNotification.

[long](#) chatRoomID

The ID of the ChatRoom assigned to the UserNotification.

[long](#) itemID

The ID of the Item assigned to the UserNotification.

[int](#) itemCount

The number of Items assigned to the UserNotification.

[string](#) socialType

The type of social network which caused the UserNotification to be created. Pass in "FB" for Facebook. Pass in "" if not specified.

[string](#) socialID

The ID of the user on a social network. Pass in the user's FacebookID for Facebook. Pass in "0" if not specified.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Delete()

Deletes a UserNotification. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserNotificationManager.Delete( userNotificationID, callbackFunc )
Parameters

long userNotificationID

The ID of the UserNotification to delete.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

GetAll()

Gets all UserNotifications for the User. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserNotificationManager.GetAll( processed, callbackFunc )
Parameters

bool processed

A boolean indicating whether processed or unprocessed UserNotifications should be retrieved.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Process()

Processes a UserNotification. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserNotificationManager.Process( userNotificationID, accepted, callbackFunc )
Parameters

long userNotificationID

The ID of the UserNotification that is to be processed.

[bool](#) accepted

A 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.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️