[ ] Set a global URL
[ ] connected_state
=> connected?
[ ] auth
no longer calls cancel
block
[ ] unauth
=> logout
[ ] auth_state
=> authenticated?
[ ] on_auth
=> authenticated?
[ ] FirebaseSimpleLogin is GONE
Firebase.url = 'your-app-name'
This is required if you want to use the static methods like Firebase.connected?
connected_state
is still around, but it has been improved and renamed to
connected?
, which accepts a block. Instead of a snapshot, this block will
receive a boolean (is_connected
).
This method used to call authWithCredential(withCompletionBlock:withCancelBlock:)
,
but that method has been deprecated in favor of authWithCustomToken(withCompletionBlock:)
.
The new method uses just one block. You should update your code to accept
error
and auth_data
arguments, and use Firebase.authenticated?
to monitor
authenticated state.
Firebase.authenticate(token) { |error, auth_data| }
Is now Firebase.logout
Is gone, in favor of Firebase.authenticated?
. You can no longer get a
Firebase ref that points to the auth state directly.
Is gone, in favor of Firebase.authenticated?
No more motion-firebase-auth
at all. Porting is pretty easy, though.
Before, you had to get create a FirebaseSimpleLogin object
auth = FirebaseSimpleLogin.new(firebase_ref)
auth.login(email: email, password: password)
auth.logout
Now you just use the firebase_ref
directly, and it's encouraged to use the
static version of these methods.
Firebase.login(email: email, password: password)
Firebase.logout
Many of the methods like create
, etc are appended with _user
, and again the
static version is encouraged.
# FirebaseSimpleLogin methods:
auth.create(email:, password:)
auth.remove(email:, password:) { |error| }
auth.login(email:, password:) { |error, user| }
auth.update(email:, old_password:, new_password:) { |error, success| }
auth.send_password_reset(email:)
# are now:
Firebase.create_user_and_login(email:, password:) { |error, auth_data| }
Firebase.create_user(email:, password:) { |error| } # user is not logged in!
Firebase.remove_user(email:, password:) { |error| }
Firebase.login(email:, password:) { |error, auth_data| }
Firebase.update_user(email:, old_password:, new_password:) { |error| }
Firebase.send_password_reset(email:) { |error| }
# this one is new:
Firebase.login_anonymously { |error, auth_data| }
Removed methods:
auth.check { |error, user| }
Firebase.authenticated? { |is_authenticated| } # does the same thing, pretty much
The Facebook and Twitter methods are different, you'll need to use
open_facebook_session
and open_twitter_session
. The old methods
(login_to_facebook
) did a lot more, but at the sacrifice that you lost some
control of your app. The new methods are more hands off.