Example #1
0
        public async Task <List <UserRecord> > GetUsers()
        {
            List <UserRecord> users = new List <UserRecord>();
            var enumerator          = firebaseAuth.ListUsersAsync(null).GetEnumerator();

            while (await enumerator.MoveNext())
            {
                users.Add(enumerator.Current);
            }

            return(users);
        }
Example #2
0
        public async Task <ListDataResult <AppUserDto> > ListUsersAsync(string pageToken)
        {
            var    users           = new List <AppUserDto>();
            string nextPageToken   = null;
            var    pagedEnumerable = _firebaseAuth.ListUsersAsync(new ListUsersOptions {
                PageToken = pageToken
            });
            var responses = pagedEnumerable.AsRawResponses().GetAsyncEnumerator();

            while (await responses.MoveNextAsync())
            {
                ExportedUserRecords response = responses.Current;
                nextPageToken = response.NextPageToken;
                foreach (ExportedUserRecord user in response.Users)
                {
                    // user.UserMetaData.LastSignInTimestamp
                    users.Add(user.To <AppUserDto>());
                }
            }
            return(new ListDataResult <AppUserDto>(nextPageToken, users));
        }