mk-5 / gdx-fireapp

libGDX Firebase API
Apache License 2.0
65 stars 21 forks source link

Updating the current user. #11

Closed kasandrop closed 5 years ago

kasandrop commented 5 years ago

Thanks a lot for resolving previous issues so quick and efficient. Especially the new feature which allows to send an email to the user to verify the email address. But there is a problem. When the current user clicks the link provided in the email it is not easy to check that verification state of the user. FirebaseUser object is cached so in order to check verification state of a user, android developer will call .getCurrentUser().reload() for an update. So that .reload() method is really missing at the moment. Thank you very much for your work.

kasandrop commented 5 years ago

There is a workaround . To force firebase to update user the following code will work:

firebaseUser.updateEmail(firebaseUser.getUserInfo().getEmail(), new CompleteCallback() {
                    @Override
                    public void onSuccess() {
                        GdxFirebaseUser firebaseUserNew=GdxFIRAuth.instance().getCurrentUser();
                        log.debug("new email:"+firebaseUserNew.getUserInfo().getEmail());
                        log.debug("email verified"+firebaseUserNew.getUserInfo().isEmailVerified());
                    }

                    @Override
                    public void onError(Exception e) {

                    }
                });
mk-5 commented 5 years ago

Mhmm okey! Thanks for the report again. I'm sorry I did not answer sooner but I was out of any working for sometime.

You will see .reload() method in the next release, for sure!