FirebaseUI-iOS icon indicating copy to clipboard operation
FirebaseUI-iOS copied to clipboard

Anonymous account automatic conversion to permanent account

Open alfongj opened this issue 10 years ago • 33 comments

Description: if this feature were implemented, FirebaseUI would have the capability of linking account credentials to an already signed-in anonymous account.

As a sub-requirement, FirebaseUI should also expose an API to handle the case where the credentials the user tries to link to correspond to an already existing account, so the developer can handle the merge case manually.

alfongj avatar Sep 19 '16 19:09 alfongj

+1 need this!

hijamoya avatar Oct 04 '16 09:10 hijamoya

+1 also need this!

codemodouk avatar Oct 13 '16 09:10 codemodouk

+1

SebastianBO avatar Oct 28 '16 13:10 SebastianBO

So, If this were implemented, I guess it would by default have the same behavior as now, unless the developer uses the exposed API, to handle it? Otherwise, it would break stuff in previous implementations, right?

yorgosg avatar Nov 23 '16 10:11 yorgosg

+1

I've actually began implementing the feature myself. But I'm having problems use my fork as Pod and test my implementation. I was not even able to build forked sources. If anyone would help me with this we might be able to put it together.

I'm solving this by adding another delegate method which will be able to grab credentials and decide if FirebaseUI controller should proceed with singing in user or not. This should handle also the sub-requirement mentioned above.

My work is here: https://github.com/ibru/FirebaseUI-iOS/tree/anonymous-link

ibru avatar Jan 19 '17 17:01 ibru

@ibru take a look at how Firebase is integrated into the ObjC sample.

Firebase is shipped as a static framework, so CocoaPods doesn't ordinarily let us use it as a dependency of a framework. We hack around this limitation by just shipping binaries, but it means testing changes locally becomes really painful.

morganchen12 avatar Jan 19 '17 18:01 morganchen12

@morganchen12 Any chance you could work on this? My PR on the Android side (https://github.com/firebase/FirebaseUI-Android/pull/309) has been waiting for months (Sep 2016). Thanks!

SUPERCILEX avatar Feb 02 '17 04:02 SUPERCILEX

Yeah, I'll try to take a look soon.

morganchen12 avatar Feb 02 '17 21:02 morganchen12

That would be amazing, thanks!

SUPERCILEX avatar Feb 02 '17 22:02 SUPERCILEX

@morganchen12 I guess there would be a way to not use the automatic conversion, right? I have done a different implementation to handle this and my code might break if this is done automatically in a future version.

yorgosg avatar Feb 02 '17 22:02 yorgosg

Yeah, automatic conversion would be an opt-in feature.

morganchen12 avatar Feb 02 '17 22:02 morganchen12

Heads up that I've began working on this change. My current progress is in this branch https://github.com/ibru/FirebaseUI-iOS/commits/anonymous-link

I've tested my implementation with email signup and it seems to work properly, it will still need to test for other sign in providers. I'll be able to finish it at some time later since I'm currently working on other parts of my app.

Feel free to grab my code and use it/improve it.

In my app, I handle anonymous account linking in newly added FUIAuthDelegate method:

func authUI(_ authUI: FUIAuth, linkAnonyousUserWith credential: FIRAuthCredential, shouldLoginNewUserCallback completion: @escaping (Bool) -> Void) {
        
        if let currentUser = FIRAuth.auth()?.currentUser, currentUser.isAnonymous {
            currentUser.link(with: credential, completion: { (user, error) in
                if error == nil {
                    completion(false)
                }
                else {
                    completion(true)
                }
            })
        }
        else {
            completion(true)
        }
    }

ibru avatar Feb 03 '17 09:02 ibru

@morganchen12 @yramanchuk Any updates on this?

SUPERCILEX avatar May 13 '17 02:05 SUPERCILEX

None, unfortunately.

morganchen12 avatar May 15 '17 18:05 morganchen12

@morganchen12 dang it, I should just learn Objective C and do it myself! 😁

SUPERCILEX avatar May 15 '17 18:05 SUPERCILEX

This issue, especially with the partial implementation above, has languished more for lack of initiative than anything else.

I'm hopeful that after I/O this week we'll have some more time to clear out the FirebaseUI iOS backlog.

morganchen12 avatar May 15 '17 18:05 morganchen12

Yeah, that would be awesome!!! I'm guessing FirebaseUI will be mentioned in the Zero to App talk and maybe a few others?

SUPERCILEX avatar May 15 '17 19:05 SUPERCILEX

Hello, are there any plans for completing this feature? I have FirebaseUI in one of my side projects and didn't have a chance to work on this recently. But if nobody is taking action in this I could try to finish my partial implementation above in coming weeks.

    1. 2017 v 20:22, Morgan Chen [email protected]:

This issue, especially with the partial implementation above, has languished more for lack of initiative than anything else.

I'm hopeful that after I/O this week we'll have some more time to clear out the FirebaseUI iOS backlog.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ibru avatar May 27 '17 07:05 ibru

No plans as of yet, though this remains one of our most requested features. @yramanchuk

morganchen12 avatar May 31 '17 20:05 morganchen12

Another huge +1 from us too. @ibru are you able to find any time to finish this off?

ApeOnFire avatar Jun 19 '17 15:06 ApeOnFire