FirebaseAuth

The FirebaseAuth item allows user registration and authentication with the email/password authentication provider. More...

Import Statement: import VPlayPlugins 1.0
Inherits:

PluginItem

Properties

Signals

Methods

Detailed Description

Note: Check out the Firebase Plugin page for more examples!

Property Documentation

authenticated : bool

Read-only property returning true if the user is currently authenticated with any of the provided authentication methods, otherwise false.

See also loginUser() and loginUserAnonymously().


authenticatedAnonymously : bool

Read-only property returning true if the user is currently authenticated anonymously, false otherwise.

See also loginUserAnonymously().


config : FirebaseConfig

This property defines the account configuration to use for this item. It includes the Firebase project ID, app ID, API key, database URL and more.

To use the default Firebase account defined in google-services.json and GoogleService-info.plist, do not assign this property or assign null.


email : string

Read-only property returning the email address of the user, if authenticated.


userId : string

Read-only property returning the userId of the authenticated user.


userToken : string

Read-only property returning the ID token of the authenticated user.


Signal Documentation

loggedIn(bool success, string message)

This signal gets emitted after the loginUser() request has finished.

The success parameter is true if the login succeeds. Otherwise, it's false. In this case, the message parameter contains an error description.

See also loginUser() and loginUserAnonymously().


passwordResetEmailSent(bool success, string message)

This signal gets emitted after the sendPasswordResetEmail() request has finished.

The success parameter is true if the e-mail was successfully sent. Otherwise, it's false. In this case, the message parameter contains an error description.

See also sendPasswordResetEmail().


userRegistered(bool success, string message)

This signal gets emitted after the registerUser() request has finished.

The success parameter is true if the registration succeeds. Otherwise, it's false. In this case, the message parameter contains an error description.

See also registerUser().


Method Documentation

void loginUser(string email, string password)

Logs in a user with the provided email and password.

After completion, the loggedIn() signal gets emitted. If the login was successful, authenticated will be true afterwards.

See also loggedIn(), registerUser(), loginUserWithToken(), loginUserAnonymously(), and logoutUser().


void loginUserAnonymously()

Logs in a user anonymously, without email and password. This method creates an anonymous account for the current device, if none exists yet.

An anonymous user can be authenticated with email and password later. You can call registerUser() while a user is already logged in anonymously. This way, the method will link the anonymous user with the provided email and password. This allows your users to sync their data across devices.

After completion, the loggedIn() signal gets emitted. If the login was successful, authenticated and authenticatedAnonymously will both be true afterwards.

Note: Anonymous authentication is not enabled by default in a Firebase project. You can enable each authentication method you would like to use in your app in the Firebase backend console. To use anonymous accounts, you can enable the sign-in method under Authentication -> Sign-in method:

See also loginUser(), loginUserWithToken(), loggedIn(), registerUser(), and logoutUser().


void loginUserWithToken(string token)

Logs in a user with the provided custom authentication token.

Login tokens can be created by custom authentication servers. You can read more about this topic in the official Firebase documentation.

After completion, the loggedIn() signal gets emitted. If the login was successful, authenticated will be true afterwards.

See also loggedIn(), registerUser(), loginUser(), loginUserAnonymously(), and logoutUser().


void logoutUser()

Logs a user out. This method always succeeds.


void registerUser(string email, string password)

Registers a user with the provided email and password. If no user is logged in, it creates a new user in the authentication backend. If an anonymous user is logged in via loginUserAnonymously(), it links the anonymous user with the provided email and password.

After completion, the userRegistered() signal gets emitted.

See also userRegistered(), loginUser(), loginUserAnonymously(), and logoutUser().


void sendPasswordResetEmail(string email)

Sends an e-mail to the user with a link to reset the password. The password-reset process is handled by Firebase. The signal passwordResetEmailSent is emitted afterwards. It supplies information whether the plugin sent the e-mail successfully.

To customize the e-mail content, go to the the Firebase Console, open your app and click Authentication -> Templates.

See also passwordResetEmailSent().


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support