-
Notifications
You must be signed in to change notification settings - Fork 6
Authentication
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more. Check the official page for more information.
Note
The SDK version is only available for Android, iOS and Web targets; if you're targeting other devices please follow the steps for REST API.
Before starting to use any Firebase extensions, you are required to follow some initial configuration steps.
- Create Project (skip this if you already have a project)
- Firebase Console (enabling Firebase Authentication)
- Platform Setup (configure SDKs or REST API)
Below is the GameMaker compatibility table for each provider depending on the target platform (keep in mind that the REST API can be used on every platform).
Provider | Android | iOS | Web | REST API |
---|---|---|---|---|
Custom | yes | yes | yes | yes |
Anonymous | yes | yes | yes | yes |
Email/Password | yes | yes | yes | yes |
Phone | yes | yes | yes | yes |
yes | yes | yes | yes | |
Apple | yes | yes | yes | yes |
yes | yes | yes | yes | |
Google Play | yes | no | no | yes |
GameCenter | no | yes | no | no |
These are the available authentication setup guides that you can follow to implement the desired authentication method in your project.
- Apple Authentication
- Custom Authentication
- Email Authentication
- Facebook Authentication
- GameCenter Authentication
- Google Authentication
- Google Play Services Authentication
- Phone Authentication
The functions listed here are given for working with Firebase Authentication extension.
These functions are only available on SDK targets (Android, iOS, Web). Check the compatibility table above.
- FirebaseAuthentication_ChangeDisplayName
- FirebaseAuthentication_ChangeEmail
- FirebaseAuthentication_ChangePassword
- FirebaseAuthentication_ChangePhotoURL
- FirebaseAuthentication_DeleteAccount
- FirebaseAuthentication_GetDisplayName
- FirebaseAuthentication_GetEmail
- FirebaseAuthentication_GetEmailVerified
- FirebaseAuthentication_GetIdToken
- FirebaseAuthentication_GetLocalId
- FirebaseAuthentication_GetPhotoUrl
- FirebaseAuthentication_GetProviderUserInfo
- FirebaseAuthentication_GetUID
- FirebaseAuthentication_GetUserData_raw
- FirebaseAuthentication_LinkWithEmailPassword
- FirebaseAuthentication_LinkWithOAuthCredential
- FirebaseAuthentication_LinkWithPhoneNumber
- FirebaseAuthentication_ReauthenticateWithEmail
- FirebaseAuthentication_ReauthenticateWithOAuth
- FirebaseAuthentication_ReauthenticateWithPhoneNumber
- FirebaseAuthentication_RecaptchaParams
- FirebaseAuthentication_RefreshUserData
- FirebaseAuthentication_SendEmailVerification
- FirebaseAuthentication_SendPasswordResetEmail
- FirebaseAuthentication_SendVerificationCode
- FirebaseAuthentication_SignIn_Anonymously
- FirebaseAuthentication_SignIn_Email
- FirebaseAuthentication_SignIn_OAuth
- FirebaseAuthentication_SignInWithCustomToken
- FirebaseAuthentication_SignInWithPhoneNumber
- FirebaseAuthentication_SignOut
- FirebaseAuthentication_SignUp_Email
- FirebaseAuthentication_UnlinkProvider
- SDKFirebaseAuthentication_LinkWithGameCenter
- SDKFirebaseAuthentication_LinkWithProvider
- SDKFirebaseAuthentication_ReauthenticateWithGameCenter
- SDKFirebaseAuthentication_ReauthenticateWithProvider
- SDKFirebaseAuthentication_SignIn_GameCenter
- SDKFirebaseAuthentication_SignInWithProvider
This function changes a user's display name and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function call requires re-authentication.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ChangeDisplayName(name)
Argument | Type | Description |
---|---|---|
name | String | The new display name to be assigned to the current user. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ChangeDisplayName"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ChangeDisplayName("YoYoUser");
In the code above we initiate a task to change the display name of the user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ChangeDisplayName")
{
if (async_load[? "status"] == 200)
{
show_debug_message("The display name was changed.");
}
else
{
show_debug_message("There was an error changing the display name.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function changes a user's email and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function call requires re-authentication.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ChangeEmail(email)
Argument | Type | Description |
---|---|---|
String | The new email address to be assigned to the current user. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ChangeEmail"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ChangeEmail("[email protected]");
In the code above we initiate a task to change the email of the user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ChangeEmail")
{
if (async_load[? "status"] == 200)
{
show_debug_message("The email was changed.");
}
else
{
show_debug_message("There was an error changing the email.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function changes a user's password and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function call requires re-authentication.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ChangePassword(password)
Argument | Type | Description |
---|---|---|
password | String | The new password for the current user account. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ChangePassword"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ChangePassword("Password123!");
In the code above we initiate a task to change the password of the user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ChangePassword")
{
if (async_load[? "status"] == 200)
{
show_debug_message("The email was changed.");
}
else
{
show_debug_message("There was an error changing the email.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function changes a user's photo URL and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function call requires re-authentication.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ChangePhotoURL(url)
Argument | Type | Description |
---|---|---|
url | String | The new photo url to be assign to the current user account. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ChangePhotoURL"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ChangePhotoURL(global.photoURL);
In the code above we initiate a task to change the photo URL of the user to a new value store in a global variable (global.photoURL
). The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ChangePhotoURL")
{
if (async_load[? "status"] == 200)
{
show_debug_message("The photo URL was changed.");
}
else
{
show_debug_message("There was an error changing the photo URL.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function deletes the current user account and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function call requires re-authentication.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_DeleteAccount()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_DeleteAccount"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_DeleteAccount();
In the code above we initiate a task to delete the current user account. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_DeleteAccount")
{
if (async_load[? "status"] == 200)
{
show_debug_message("The account was deleted.");
}
else
{
show_debug_message("There was an error deleting the account.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function returns the display name of the current user.
Syntax:
FirebaseAuthentication_GetDisplayName()
Returns:
Example:
var _displayName = FirebaseAuthentication_GetDisplayName();
The code above will retrieve the current user's display name and store it in a local variable.
This function returns the email of the current user.
Syntax:
FirebaseAuthentication_GetEmail()
Returns:
Example:
var _email = FirebaseAuthentication_GetEmail();
The code above will retrieve the current user's email and store it in a local variable.
This function returns whether or not the email of the current user is verified.
Syntax:
FirebaseAuthentication_GetEmailVerified()
Returns:
Example:
var _emailVerified = FirebaseAuthentication_GetEmailVerified();
if (!_emailVerified)
{
listenerId = FirebaseAuthentication_SendEmailVerification();
}
The code above will check if the current user's email is verified, and if it's not, it'll call FirebaseAuthentication_SendEmailVerification to start the verification process.
This function requests a callback to get the current idToken and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_GetIdToken()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_GetIdToken"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | The idToken (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_GetIdToken();
In the code above we request for the current session's idToken. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ReauthenticateWithEmail")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function returns the local identifier (uid) of the current user.
Note
This function returns the same value as FirebaseAuthentication_GetUID.
Syntax:
FirebaseAuthentication_GetLocalId()
Returns:
Example:
var _uid = FirebaseAuthentication_GetLocalId();
The code above will retrieve the local identifier (uid) of the current user and store it in a local variable.
This function returns the URL of the current user's photo.
Syntax:
FirebaseAuthentication_GetPhotoUrl()
Returns:
Example:
var _photoUrl = FirebaseAuthentication_GetPhotoUrl();
The code above will retrieve current user's photo URL and store it in a local variable.
This function returns an array of structs with the information of each provider of the current user (or an empty string if unavailable). Below is a sample of the returned information string parsed as an array (using the json_parse function) for a user authenticated with Apple, Facebook, Google Play Games and Phone.
[
{
"email":"**@privaterelay.appleid.com",
"providerId":"apple.com",
"rawId":"**",
"federatedId":"**"
},
{
"displayName":"**",
"photoUrl":"https:**",
"providerId":"facebook.com",
"rawId":"**",
"federatedId":"**"
},
{
"displayName":"**",
"photoUrl":"https:**",
"providerId":"playgames.google.com",
"rawId":"**",
"federatedId":"**"
},
{
"phoneNumber":"**",
"providerId":"phone"
}
]
Syntax:
FirebaseAuthentication_GetProviderUserInfo()
Returns:
Example:
var _providerUserInfo = FirebaseAuthentication_GetProviderUserInfo();
The code above will return a JSON formatted string of an array containing provider information.
This function returns the unique identifier (uid) of the current user.
Note
This function returns the same value as FirebaseAuthentication_GetLocalId.
Syntax:
FirebaseAuthentication_GetUID()
Returns:
Example:
var _uid = FirebaseAuthentication_GetUID();
The code above will retrieve the unique identifier (_uid
) of the current user and stores it in a local variable.
This function returns a raw user representation as a JSON formatted string. Below is a sample of the returned information string parsed as a struct (using the json_parse function) with information for some of the supported providers: Apple, Facebook, Google Play Games and Phone.
{
"kind":"identitytoolkit#GetAccountInfoResponse",
"users":[
{
"email":"**",
"localId":"**8",
"emailVerified":true,
"phoneNumber":true,
"providerUserInfo":[
{
"email":"**@privaterelay.appleid.com",
"providerId":"apple.com",
"rawId":"**",
"federatedId":"**"
},
{
"displayName":"**",
"photoUrl":"https:**",
"providerId":"facebook.com",
"rawId":"**",
"federatedId":"**"
},
{
"displayName":"**",
"photoUrl":"https:**",
"providerId":"playgames.google.com",
"rawId":"**",
"federatedId":"**"
},
{
"phoneNumber":"**",
"providerId":"phone"
}
]
}
]
}
Note
It is recommended to use one of the FirebaseAuthentication_Get*
functions to get the information you need.
Syntax:
FirebaseAuthentication_GetUserData_raw(arg)
Argument | Type | Description |
---|---|---|
arg | Any | The argument to be passed in |
Returns:
Example:
var _raw_user_data = FirebaseAuthentication_GetUserData_raw();
The code above will return a JSON formatted string of an array with raw user data.
This function establishes a link between an email/password pair and the current user (used for Email Authentication based authentication). The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_LinkWithEmailPassword(email, pass)
Argument | Type | Description |
---|---|---|
String | The email to link the current user to. | |
pass | String | The password to link to the current user account. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_LinkWithEmailPassword"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_LinkWithEmailPassword("[email protected]", "myPass123!");
In the code above we attempt to link the current user with a email/password pair. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_LinkWithEmailPassword")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message("There was an error linking email/pass to current user.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function establishes a link between an OAuth credential and the current user (used for Apple Authentication, ?{page.logins_authentication#Facebook_Authentication}, Google Authentication and Google Play Services Authentication based authentications). The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_LinkWithOAuthCredential(token, token_kind, provider, redirect_uri=undefined)
Argument | Type | Description |
---|---|---|
token | String | The provider token. |
token_kind | String | One of the provided strings "id_token" , "access_token" or "serverAuthCode"
|
provider | String | The provider identifier (e.g. "apple.com" , "google.com" , etc.) |
redirect_uri | String | Only for REST API (can be checked on the Firebase Console for your provider) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_LinkWithOAuthCredential"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_LinkWithOAuthCredential(token, token_kind, provider, redirect_uri);
In the code above we attempt to link the current user with an OAuth credential. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_LinkWithEmailPassword")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message("There was an error linking OAuth credential to current user.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function establishes a link between a phone number and the current user. The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_LinkWithPhoneNumber(phone, code, session_info)
Argument | Type | Description |
---|---|---|
phone | String | The phone number, including country number (i.e.: "+44123456789" ) |
code | String | The code from the SMS. |
session_info | String | Session info from the re-catcha puzzle. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_LinkWithPhoneNumber"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_LinkWithPhoneNumber(phone, code, sessionInfo);
In the code above we attempt to link the current user with a phone number. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_LinkWithPhoneNumber")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message("There was an error linking phone number to current user.");
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function re-authenticates the current user using an email/password (used for Email Authentication based authentication). The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ReauthenticateWithEmail(email, pass)
Argument | Type | Description |
---|---|---|
String | The email to link the current user to. | |
pass | String | The password to link to the current user account. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ReauthenticateWithEmail"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ReauthenticateWithEmail("[email protected]", "myPass123!");
In the code above we attempt to re-authenticate the current user with a email/password pair. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ReauthenticateWithEmail")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function re-authenticates the current user using an OAuth credential (used for Apple Authentication, Facebook Authentication, Google Authentication and Google Play Services Authentication). The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ReauthenticateWithOAuth(token, token_kind, provider, redirect_uri)
Argument | Type | Description |
---|---|---|
token | String | The provider token. |
token_kind | String | One of the provided strings "id_token" or "access_token" or "serverAuthCode"
|
provider | String | The provider identifier (i.e.: "apple.com" , "google.com" , etc.) |
redirect_uri | String | Only for REST API (can be checked on the Firebase Console for your provider) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ReauthenticateWithOAuth"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ReauthenticateWithOAuth(token, token_kind, provider, redirect_uri);
In the code above we attempt to re-authenticate the current user with an OAuth credential. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ReauthenticateWithOAuth")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function re-authenticates the current user using a phone number. The returned value is a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_ReauthenticateWithPhoneNumber(phone, code, session_info)
Argument | Type | Description |
---|---|---|
phone | String | The phone number, including country number (i.e.: "+44123456789" ) |
code | String | The code from the SMS. |
session_info | String | Session info from the re-catcha puzzle. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ReauthenticateWithPhoneNumber"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | User raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ReauthenticateWithPhoneNumber(phone, code, sessionInfo);
In the code above we try to re-authenticate the current user with a phone number. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_ReauthenticateWithPhoneNumber")
{
if (async_load[? "status"] == 200)
{
show_debug_message(json_parse(async_load[? "value"]));
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function requests a recaptchaSiteKey and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_RecaptchaParams()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_RecaptchaParams"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with recaptchaSiteKey (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_RecaptchaParams();
In the code above we attempt to get the recaptcha parameters that can be used for phone number authentication (see FirebaseAuthentication_LinkWithPhoneNumber). The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_RecaptchaParams")
{
if (async_load[? "status"] == 200)
{
var data = json_decode(async_load[? "value"]);
var recaptchaSiteKey = data.recaptchaSiteKey;
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function can be used to refresh the user data and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_RefreshUserData()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_RefreshUserData"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the recaptchaSiteKey value (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_RefreshUserData();
In the code above we attempt to refresh the current user's data. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_RefreshUserData")
{
if (async_load[? "status"] == 200)
{
var data = json_decode(async_load[? "value"]);
show_debug_message(data);
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function sends an email verification to the current user (used for Email Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SendEmailVerification(email)
Argument | Type | Description |
---|---|---|
String | The email to be verified. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SendEmailVerification"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SendEmailVerification();
In the code above we attempt to send an email verification to the current user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_RefreshUserData")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Email verification succeeded");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function sends a password reset email to the current user (used for Email Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SendPasswordResetEmail(email)
Argument | Type | Description |
---|---|---|
String | The email to send the password reset email to. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SendPasswordResetEmail"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | The return value (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SendPasswordResetEmail("[email protected]");
In the code above we attempt to send a password reset email to the current user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_SendPasswordResetEmail")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Email verification succeeded");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function sends a verification code and requests for a sessionInfo key (used for Phone Authentication based authentication), it then returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SendVerificationCode(phoneNumber, recaptchaToken)
Argument | Type | Description |
---|---|---|
phoneNumber | String | The phone number to send the verification code to, including country code (i.e.: "+44123456789" ) |
recaptchaToken | String | The recaptcha token (obtained from solving the reCAPTCHA puzzle). |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SendVerificationCode"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the sessionInfo **value (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SendVerificationCode(phoneNumber, recaptchaToken);
In the code above we attempt to send a verification code to the current user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_SendVerificationCode")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Verification code sent!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in a user anonymously and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignIn_Anonymously()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignIn_Anonymously"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignIn_Anonymously();
In the code above we attempt to sign in the current user anonymously. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_SignIn_Anonymously")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in a user with an email and password (used for Email Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignIn_Email(email, pass)
Argument | Type | Description |
---|---|---|
String | The email to sign in with. | |
pass | String | The password associated with the email above (not the actual email's password). |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignIn_Email"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignIn_Email("[email protected]", "mypass123!");
In the code above we attempt to sign in the current user using an email/password. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_SignIn_Email")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in a user with an OAuth credential (used for Apple Authentication, Facebook Authentication, Google Authentication and Google Play Services Authentication based authentications) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignIn_OAuth(token, token_kind, provider, redirect_uri=undefined)
Argument | Type | Description |
---|---|---|
token | String | The provider token. |
token_kind | String | One of the provided strings "id_token" , "access_token" or "serverAuthCode"
|
provider | String | The provider identifier (i.e.: "apple.com" , "google.com" , etc.) |
redirect_uri | String | The redirect URI if using REST API (can be checked on the Firebase Console for your provider) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignIn_OAuth"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignIn_OAuth(token, token_kind, provider, redirect_uri);
In the code above we attempt to sign in the current user using an OAuth credential. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "type"] == "FirebaseAuthentication_SignIn_OAuth")
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event type, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function tries to sign in a user with a given custom token. Use this function after you retrieve a Firebase Auth Custom Token from your server (used with Custom Authentication). The function returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignInWithCustomToken(customToken)
Argument | Type | Description |
---|---|---|
customToken | String | The user's Firebase custom token. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignInWithCustomToken"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignIn_OAuth(token, token_kind, provider, redirect_uri);
In the code above we attempt to sign in the current user using an OAuth credential. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in a user with a phone number (used for Phone Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignInWithPhoneNumber(phone, code, session_info)
Argument | Type | Description |
---|---|---|
phone | String | The phone number, including country code (i.e.: "+44123456789" ) |
code | String | The code from the SMS. |
session_info | String | Session info from the re-captcha puzzle. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignInWithPhoneNumber"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignInWithPhoneNumber(phone, code, sessionInfo);
In the code above we attempt to sign in the current user using a phone number. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs out the current user.
Syntax:
FirebaseAuthentication_SignOut()
Returns:
N/A
Example:
FirebaseAuthentication_SignOut();
The code above will log the current user out of the Firebase Authentication system.
This function signs up a user with an email and password (used for Email Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_SignUp_Email(email, pass)
Argument | Type | Description |
---|---|---|
String | The email to to be used during sign-up. | |
pass | String | The password to be associated with the email provided (not the actual email's password) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_SignUp_Email"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_SignUp_Email("[email protected]", "mypass123!");
In the code above we attempt to sign up the current user using an email and password. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Signed up successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function unlinks a provider from the current user and returns a listener identifier that can be used for tracking progress on the request.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
FirebaseAuthentication_UnlinkProvider(provider_identifer)
Argument | Type | Description |
---|---|---|
provider_identifer | String | The provider identifier (e.g. "apple.com" , "google.com" , "phone" , etc.) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_UnlinkProvider"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_UnlinkProvider("apple.com");
In the code above we attempt to unlink the provider "apple.com"
from the current user. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Unliked provider successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function links a Game Center account to the current user (used for GameCenter Authentication) based authentication) and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on iOS.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_LinkWithGameCenter()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_LinkWithGameCenter"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_LinkWithGameCenter();
In the code above we attempt to link the current user to a game center account. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Account linked successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function links the user account with a specific provider (the user needs to be signed in) and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on Android, iOS and Web.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_LinkWithProvider(provider)
Argument | Type | Description |
---|---|---|
provider | String | The provider identifier (i.e.: "apple.com" , "google.com" , etc.) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "SDKFirebaseAuthentication_LinkWithProvider"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = SDKFirebaseAuthentication_LinkWithProvider("apple.com");
In the code above we attempt to link the current user to the "apple.com"
provider (see Apple Authentication for more information on this authentication method). The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Account linked successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function re-authenticates the user using a Game Center account (used for GameCenter Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on iOS.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_ReauthenticateWithGameCenter()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "FirebaseAuthentication_ReauthenticateWithGameCenter"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = FirebaseAuthentication_ReauthenticateWithGameCenter();
In the code above we attempt to re-authenticate the current user using a game center account. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Account linked successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function re-authenticates the user account with a specific provider (the user needs to be signed in) and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on Android, iOS and Web.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_ReauthenticateWithProvider(provider)
Argument | Type | Description |
---|---|---|
provider | String | The provider identifier (i.e.: "apple.com" , "google.com" , etc.) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "SDKFirebaseAuthentication_ReauthenticateWithProvider"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = SDKFirebaseAuthentication_ReauthenticateWithProvider("apple.com");
In the code above we attempt to re-authenticate the current user to the "apple.com"
provider (see Apple Authentication for more information on this authentication method). The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Account re-authenticated successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in the current user with a Game Center account (used for GameCenter Authentication based authentication) and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on iOS.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_SignIn_GameCenter()
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "SDKFirebaseAuthentication_SignIn_GameCenter"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data (if status == 200) |
errorMessage | String | The readable error message |
Example:
listenerId = SDKFirebaseAuthentication_SignIn_GameCenter();
In the code above we attempt to sign in the current using a game center account. The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("Account linked successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
This function signs in the user using the browser account native to a specific provider and returns a listener identifier that can be used for tracking progress on the request.
Warning
This function is only available on Android, iOS and Web.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
SDKFirebaseAuthentication_SignInWithProvider(provider)
Argument | Type | Description |
---|---|---|
provider | String | The provider identifier (i.e.: "apple.com" , "google.com" , etc) |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "SDKFirebaseAuthentication_SignInWithProvider"
|
listener | Real | The asynchronous listener ID. |
status | Real | The HTTP status response code (see reference) |
value | String | A JSON formatted string with the user's raw data |
errorMessage | String | The readable error message |
Example:
listenerId = SDKFirebaseAuthentication_SignInWithProvider("apple.com");
In the code above we attempt to sign in the current user using the "apple.com"
provider (see Apple Authentication for more information on this authentication method). The function call will then return a listener ID (listenerId
) that can be used inside a Social Async Event.
if (async_load[? "id"] == listenerId)
{
if (async_load[? "status"] == 200)
{
show_debug_message("User signed in successfully!");
}
else
{
show_debug_message(async_load[? "errorMessage"]);
}
}
The code above matches the response against the correct event listener id, checks for a status value of 200
meaning that it was successful and logs the result of the task.
GameMaker 2024