Skip to content

Instantly share code, notes, and snippets.

@hiranya911
Created December 9, 2017 01:13
Show Gist options
  • Save hiranya911/1b8366005e5c8fc8bfb10659cd7047df to your computer and use it in GitHub Desktop.
Save hiranya911/1b8366005e5c8fc8bfb10659cd7047df to your computer and use it in GitHub Desktop.
// Start listing users from the beginning, 1000 at a time.
ListUsersPage page = FirebaseAuth.getInstance().listUsersAsync(null).get();
while (page != null) {
for (ExportedUserRecord user : page.getValues()) {
System.out.println("User: " + user.getUid());
}
page = page.getNextPage();
}
// Iterate through all users. This will still retrieve users in batches,
// buffering no more than 1000 users in memory at a time.
page = FirebaseAuth.getInstance().listUsersAsync(null).get();
for (ExportedUserRecord user : page.iterateAll()) {
System.out.println("User: " + user.getUid());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment