Example #1
0
        //---------------------------------------------------------------------
        // Internal
        //---------------------------------------------------------------------

        private void UpdateNotificationsCount()
        {
            ShowCount(false);

            var notificationsCountQuery = NotificationsCountQuery.Unread().OfTypes(
                Notification.NotificationTypes.Comment,
                Notification.NotificationTypes.Direct,
                Notification.NotificationTypes.MentionInActivity,
                Notification.NotificationTypes.MentionInComment,
                Notification.NotificationTypes.ReplyToComment,
                Notification.NotificationTypes.Targeting);

            Debug.Log("Username: "******"99+" : count.ToString();
                Debug.Log("Notifications count: " + count);
                ShowCount(count > 0);
            },
                onError: error =>
            {
                Debug.LogErrorFormat("Failed to retrieve notifications count, error: {0}", error.Message);
            });
        }
Example #2
0
    void UpdateCount()
    {
        var query = NotificationsCountQuery.WithStatuses(Filters.Where((t, i) => _selectedFilters[i]).ToArray());

        if (_likedAndComments)
        {
            query.OfTypes(Notification.NotificationTypes.Comment, Notification.NotificationTypes.LikeActivity, Notification.NotificationTypes.LikeComment);
        }

        if (_actions.Count > 0)
        {
            query.WithActions(_actions.ConvertAll(it => it.ActionId).ToArray());
        }

        GetSocial.User.GetNotificationsCount(query, i => _count = i, Debug.LogError);
    }