Firebase.Unity.Editor.FirebaseEditorExtensions

These settings provide configuration settings for the UnityEditor.

Summary

This allows you to control the behavior of the FirebaseDatabase when testing within the UnityEditor. NOTE: This API is likely to change in the future.

Public static functions

GetCertPemFile(this FirebaseApp app)
string
Deprecated. Root certificates is no longer used.
Gets the cert pem file.
GetEditorAuthUserId(this FirebaseApp app)
string
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Gets the editor auth user identifier.
GetEditorDatabaseUrl(this FirebaseApp app)
string
Gets the editor database URL when running in the Editor.
GetEditorP12FileName(this FirebaseApp app)
string
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Gets the name of the editor p12 file.
GetEditorP12Password(this FirebaseApp app)
string
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Gets the editor p12 password.
GetEditorServiceAccountEmail(this FirebaseApp app)
string
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Gets the editor service account email.
SetCertPemFile(this FirebaseApp app, string certName)
void
Deprecated. Root certificates is no longer used.
Sets the cert pem file.
SetEditorAuthUserId(this FirebaseApp app, string uid)
void
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().
{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules
Sets the editor auth user identifier to impersonate when using a service account.
SetEditorDatabaseUrl(this FirebaseApp app, string databaseUrl)
void
Sets the editor database URL when running in the Editor.
SetEditorDatabaseUrl(this FirebaseApp app, Uri databaseUrl)
void
Sets the editor database URL when running in the Editor.
SetEditorP12FileName(this FirebaseApp app, string p12Filename)
void
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().
{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules
Sets the name of the editor p12 file.
SetEditorP12Password(this FirebaseApp app, string p12Password)
void
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().
{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules
Sets the service account password.
SetEditorServiceAccountEmail(this FirebaseApp app, string email)
void
Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().
{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules
Sets the editor service account email.

Public static functions

GetCertPemFile

string GetCertPemFile(
  this FirebaseApp app
)

Gets the cert pem file.

Deprecated. Root certificates is no longer used.

Details
Parameters
app
App.
Returns
The cert pem file.

GetEditorAuthUserId

string GetEditorAuthUserId(
  this FirebaseApp app
)

Gets the editor auth user identifier.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.

Details
Parameters
app
App.
Returns
The editor auth user identifier.

GetEditorDatabaseUrl

string GetEditorDatabaseUrl(
  this FirebaseApp app
)

Gets the editor database URL when running in the Editor.

Details
Parameters
app
App.
Returns
The editor database URL.

GetEditorP12FileName

string GetEditorP12FileName(
  this FirebaseApp app
)

Gets the name of the editor p12 file.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.

Details
Parameters
app
App.
Returns
The editor p12 file name.

GetEditorP12Password

string GetEditorP12Password(
  this FirebaseApp app
)

Gets the editor p12 password.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.

Details
Parameters
app
App.
Returns
The editor p12 password.

GetEditorServiceAccountEmail

string GetEditorServiceAccountEmail(
  this FirebaseApp app
)

Gets the editor service account email.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.

Details
Parameters
app
App.
Returns
The editor service account email.

SetCertPemFile

void SetCertPemFile(
  this FirebaseApp app,
  string certName
)

Sets the cert pem file.

This optionally provides an extra set of root ssl certificates that will be installed within mono configuration. By default, the SDK includes a set of root certificates that Google requires to validate the Ssl connection with the Firebase server.

Deprecated. Root certificates is no longer used.

Details
Parameters
app
App.
certName
Cert name.

SetEditorAuthUserId

void SetEditorAuthUserId(
  this FirebaseApp app,
  string uid
)

Sets the editor auth user identifier to impersonate when using a service account.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().

{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules

Details
Parameters
app
App.
uid
Uid.

SetEditorDatabaseUrl

void SetEditorDatabaseUrl(
  this FirebaseApp app,
  string databaseUrl
)

Sets the editor database URL when running in the Editor.

This value must be set for the FirebaseDatabase to properly connect to your FirebaseDatabase within the UnityEditor.

Details
Parameters
app
App.
databaseUrl

SetEditorDatabaseUrl

void SetEditorDatabaseUrl(
  this FirebaseApp app,
  Uri databaseUrl
)

Sets the editor database URL when running in the Editor.

This value must be set for the FirebaseDatabase to properly connect to your FirebaseDatabase within the UnityEditor.

Details
Parameters
app
App.
databaseUrl

SetEditorP12FileName

void SetEditorP12FileName(
  this FirebaseApp app,
  string p12Filename
)

Sets the name of the editor p12 file.

When running in the editor, a P12 file can be supplied with service account credentials. This allows you to run with service account authentication and impersonate any user when making updates. If you do not set up service account access, the Editor will only be able to access a FirebaseDatabase if its rules allow open access.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().

{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules

Details
Parameters
app
App.
p12Filename
P12 filename.

SetEditorP12Password

void SetEditorP12Password(
  this FirebaseApp app,
  string p12Password
)

Sets the service account password.

A service account can be used to access your FirebaseDatabase securely. If you do not set up service account access, the Editor will only be able to access a FirebaseDatabase if its rules allow open access.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().

{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules

Details
Parameters
app
App.
p12Password
P12 password.

SetEditorServiceAccountEmail

void SetEditorServiceAccountEmail(
  this FirebaseApp app,
  string email
)

Sets the editor service account email.

A service account can be used to access your FirebaseDatabase securely. If you do not set up service account access, the Editor will only be able to access a FirebaseDatabase if its rules allow open access.

Deprecated. Service account in Unity editor is no longer supported. Please use Admin SDK instead.
Alternatively, you can add a user account through Firebase Console with email/password and modified Database rules to allow read/write to this account using User UID as the following. Then sign-in on the client using Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync().

{
  "rules" : {
    "path/to/data" : {
       ".read" : "auth.uid == 'uid-of-the-dedicated-account'",
       ".write" : "auth.uid == 'uid-of-the-dedicated-account'"
    }
  }
}
See also:Database Rules

Details
Parameters
app
App.
email
Email.