Example #1
0
        public void NotificationsList(NNotificationsListMessage.Builder message,
                                      bool appendList = false, uint maxNotifications = 100)
        {
            _client.Send(message.Build(), notifications =>
            {
                if (!appendList)
                {
                    StateManager.Instance.Notifications.Clear();
                }

                foreach (var notification in notifications.Results)
                {
                    // check to see if ChatMessages has 'maxMessages' messages.
                    if (StateManager.Instance.Notifications.Count >= maxNotifications)
                    {
                        return;
                    }

                    StateManager.Instance.Notifications.Add(notification);
                }

                // Recursively fetch the next set of groups and append
                if (notifications.Cursor != null && notifications.Cursor.Value != "")
                {
                    message.Cursor(notifications.Cursor.Value);
                    NotificationsList(message, true);
                }
            }, ErrorHandler);
        }
        private void NotificationsList()
        {
            var msg = new NNotificationsListMessage.Builder(10);

            NakamaManager.Instance.NotificationsList(msg);
        }