i'm aware using twitter/facebook firebase authentication react native throws error since that's not right env open new auth window. also, email/password auth should fail since it's reliant upon localstorage react native doesn't support. best way implement sort of firebase authentication in react native create swift/objc bridge use swift/objc firebase auth library? if so, have examples of doing this?
update: of firebase 3.x, firebase authentication correctly persist users in react native apps.
ahh, didn't realize react native didn't polyfill localstorage. if understand question right, email/password auth firebase works fine in react native, except not persisted across app starts, user has log in every time.
one possible solution manually persist auth token yourself. like:
- call authwithpassword(...) usual.
- in oncomplete handler, retrieve authdata.authtoken , store locally (e.g. using asyncstorage).
- on next app start, retrieve auth token storage , call authwithcustomtoken(authtoken, ...).
we'll making firebase automatically, it's bit tricky without affecting other consumers of firebase besides react. i've added our internal bug database though , we'll see can come with. we'll update answer when have solution. thanks!
Comments
Post a Comment