Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/bg/firebase

Manage interaction with firebase and its Namespaces https://firebase.google.com/docs/web/setup

Index

Variables

Const ERROR_TOKEN

ERROR_TOKEN: "Failed to obtain messaging token." = "Failed to obtain messaging token."

Error message for regToken

Const ERROR_USER

ERROR_USER: "Failed to obtain user information." = "Failed to obtain user information."

Error message for failure to get signed in user

Let app

app: App | null = null

Firebase app

Let auth

auth: Auth

Firebase auth Namespace

Let messaging

messaging: Messaging

Firebase messaging Namespace

Functions

deleteFirebaseApp

  • deleteFirebaseApp(): Promise<void>

getRegToken

  • getRegToken(): Promise<string>

initialize

  • initialize(swReg: ServiceWorkerRegistration): Promise<void>
  • Initialize the firebase libraries

    throws

    An error on failure

    Parameters

    • swReg: ServiceWorkerRegistration

      service worker

    Returns Promise<void>

initializeFirebase

  • initializeFirebase(swReg: ServiceWorkerRegistration): Promise<void>
  • Initialize firebase and its Namespaces

    throws

    An error on failure

    Parameters

    • swReg: ServiceWorkerRegistration

      use own ServiceWorker

    Returns Promise<void>

refreshRegToken

  • refreshRegToken(): Promise<void>

signIn

  • signIn(token: string): Promise<User>
  • SignIn to firebase

    throws

    An error on failure

    Parameters

    • token: string

      auth token

    Returns Promise<User>

    The current firebase user

signOut

  • signOut(): Promise<void>

Generated using TypeDoc