chat-sdk / chat-sdk-ios

Chat SDK iOS - Open Source Mobile Messenger
http://sdk.chat
Other
913 stars 276 forks source link

Customize sign in with phone number #477

Closed LeonardoPasseri closed 3 years ago

LeonardoPasseri commented 3 years ago

Hello,

As far as I understood the only way to provide phone number authentication is through FirebaseUI.

Unfortunately, it seems that ChatSDK doesn't allow to specify custom subclasses for FirebaseUI view controllers, since FirebaseUIModule assign itself to FIRAuth.delegate and returns an instance of FUIAuthPickerViewController, preventing the client code from specifying a custom auth picker view controller (and any other auth-related custom view controller).

However, FirebaseUI looks poorly customizable even if custom view controllers could be used (e.g. no clean way to customize sign in buttons).

Can you suggest a way to use a custom login view controller that provides phone number authentication?

Thanks

bensmiley commented 3 years ago

Hi @LeonardoPasseri the Firebase UI ChatSDK module is a very lightweight wrapper around Firebase UI. If you want to customize it you can just copy-paste those classes into your project.

Firebase UI is not very customizable as you said. But it's not hard to re-implement the UI using Firebase APIs.

For example, for phone auth you would follow this guide:

https://firebase.google.com/docs/auth/ios/phone-auth

LeonardoPasseri commented 3 years ago

Hi, @bensmiley. I managed to customize the sign-in with phone number flow by forking FirebaseUI and making the needed changes. Thank you for your help.