I am authenticating anonymously to access firebase but I would like the self-assigned UID to be according to a standard that I have defined, then I leave the anonymous authentication code I use:
auth.signInAnonymously()
.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
mUsername = idChat.substring(0, 10);
id = task.getResult()
.getUser()
.getUid();
isLoggedIn = true;
mPhotoUrl = "";
initAdapter();
}
})
.addOnFailureListener(task -> displayError(task.getMessage()));