### Install Plugin with AI-Assisted Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/analytics/README.md Use the Capawesome Skills to add the plugin to your project. This is an alternative to manual setup. ```bash npx skills add capawesome-team/skills --skill capacitor-plugins ``` ```bash Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-firebase/analytics` plugin in my project. ``` -------------------------------- ### Install Plugin with AI-Assisted Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/README.md Use the Capawesome Skills to add the plugin to your project. This is an alternative to manual setup. ```bash npx skills add capawesome-team/skills --skill capacitor-plugins ``` ```bash Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-firebase/messaging` plugin in my project. ``` -------------------------------- ### Install Plugin with Manual Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/analytics/README.md Install the plugin and its peer dependency 'firebase' using npm, then sync your Capacitor project. ```bash npm install @capacitor-firebase/analytics firebase npx cap sync ``` -------------------------------- ### Install @capacitor-firebase/storage with Manual Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Install the plugin and sync your Capacitor project. ```bash npm install @capacitor-firebase/storage npx cap sync ``` -------------------------------- ### Install Plugin with Manual Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/README.md Install the plugin and its dependencies using npm and sync with Capacitor. Ensure Firebase is added to your project separately. ```bash npm install @capacitor-firebase/messaging firebase npx cap sync ``` -------------------------------- ### Install Plugin with AI-Assisted Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/remote-config/README.md Use the Capawesome Skills AI tool to add the plugin to your project. ```bash npx skills add capawesome-team/skills --skill capacitor-plugins ``` ```bash Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-firebase/remote-config` plugin in my project. ``` -------------------------------- ### Install @capacitor-firebase/storage with AI-Assisted Setup Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Use the Capawesome Skills to add the plugin to your project. ```bash npx skills add capawesome-team/skills --skill capacitor-plugins ``` ```bash Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-firebase/storage` plugin in my project. ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/CONTRIBUTING.md Run this command after forking and cloning the repository to install all necessary project dependencies. ```shell npm install ``` -------------------------------- ### Install Plugin Manually Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Install the plugin using npm and sync with Capacitor. ```bash npm install @capacitor-firebase/firestore npx cap sync ``` -------------------------------- ### Start a Trace Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Starts a new performance trace with a given name. ```APIDOC ## startTrace ### Description Starts a new performance trace with a given name. ### Method `FirebasePerformance.startTrace` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace to start. ### Request Example ```typescript await FirebasePerformance.startTrace({ traceName: 'test_trace' }); ``` ``` -------------------------------- ### Install Plugin Manually Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/functions/README.md Install the plugin using npm and then sync with Capacitor. Ensure Firebase is added to your project. ```bash npm install @capacitor-firebase/functions npx cap sync ``` -------------------------------- ### Install Previous Version (Capacitor 3) Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/BREAKING.md If you need to use this plugin with Capacitor 3, install version 0.5.1. ```bash npm i @capacitor-firebase/messaging@0.5.1 ``` -------------------------------- ### Install Plugin with AI Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/functions/README.md Use the Capawesome Skills AI to install the plugin. Add the Capawesome Skills to your AI tool first. ```bash npx skills add capawesome-team/skills --skill capacitor-plugins ``` -------------------------------- ### Install Plugin with npm Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/README.md Install the plugin and its peer dependency using npm. Run `npx cap sync` afterwards to sync native projects. ```bash npm install @capacitor-firebase/app-check firebase npx cap sync ``` -------------------------------- ### Install Previous Version for Capacitor 3 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/crashlytics/BREAKING.md If you need to use this plugin with Capacitor 3, install version 0.5.1. ```bash npm i @capacitor-firebase/crashlytics@0.5.1 ``` -------------------------------- ### Install Previous Version (Capacitor 3) Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app/BREAKING.md If you need to use this plugin with Capacitor 3, install version 0.5.1. ```bash npm i @capacitor-firebase/app@0.5.1 ``` -------------------------------- ### Install Capacitor 3 Compatibility Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/BREAKING.md If you need to use this plugin with Capacitor 3, install version `0.5.1`. ```bash npm i @capacitor-firebase/authentication@0.5.1 ``` -------------------------------- ### Install Previous Version for Capacitor 3 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/analytics/BREAKING.md If you need to use this plugin with Capacitor 3, install version 0.5.1. ```bash npm i @capacitor-firebase/analytics@0.5.1 ``` -------------------------------- ### Install @capacitor-firebase/performance Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Install the plugin and Firebase core package using npm. Run `npx cap sync` to integrate native dependencies. ```bash npm install @capacitor-firebase/performance firebase npx cap sync ``` -------------------------------- ### Install @capacitor-firebase/crashlytics Plugin Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/crashlytics/README.md Install the plugin using npm and sync with Capacitor. ```bash npm install @capacitor-firebase/crashlytics npx cap sync ``` -------------------------------- ### Install Plugin Manually Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/remote-config/README.md Install the plugin and sync your Capacitor project. Ensure Firebase is added to your project for Android, iOS, and Web. ```bash npm install @capacitor-firebase/remote-config firebase npx cap sync ``` -------------------------------- ### Install Previous Version (Capacitor 4) Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/messaging@1.4.0 ``` -------------------------------- ### Install Previous Version for Capacitor 3 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/BREAKING.md If you need to use this plugin with Capacitor 3, install version 0.5.1. Ensure your project meets Capacitor 4 requirements before upgrading. ```bash npm i @capacitor-firebase/performance@0.5.1 ``` -------------------------------- ### Install @capacitor-firebase/app Plugin Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app/README.md Install the plugin and Firebase core package using npm. Run `npx cap sync` to update native projects. ```bash npm install @capacitor-firebase/app firebase npx cap sync ``` -------------------------------- ### Start a Firebase Performance Trace Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Use this function to start a performance trace. Ensure the 'options' object is correctly configured with the trace name. ```typescript startTrace(options: StartTraceOptions) => Promise ``` -------------------------------- ### Install Previous Version (Capacitor 4) Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/app@1.4.0 ``` -------------------------------- ### Manual Installation of Capacitor Firebase Authentication Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Install the plugin and Firebase core package using npm, then sync with Capacitor. Ensure Firebase is added to your project separately. ```bash npm install @capacitor-firebase/authentication firebase npx cap sync ``` -------------------------------- ### Install Previous Version for Capacitor 4 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/crashlytics/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/crashlytics@1.4.0 ``` -------------------------------- ### Usage Examples Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/README.md Demonstrates how to use the FirebaseAppCheck plugin for initialization, token retrieval, and listener management. ```APIDOC ## Initialize Firebase App Check ### Description Initializes the Firebase App Check plugin, optionally configuring a reCAPTCHA provider for web platforms. ### Method Signature `FirebaseAppCheck.initialize(options?: { provider?: Provider })` ### Parameters - `options` (object) - Optional. Configuration options for initialization. - `provider` (Provider) - Optional. The App Check provider to use. For web, `ReCaptchaV3Provider` is recommended. ### Example ```typescript import { FirebaseAppCheck } from '@capacitor-firebase/app-check'; import { ReCaptchaV3Provider } from '@capacitor-firebase/app-check'; import { Capacitor } from '@capacitor/core'; const initialize = async () => { await FirebaseAppCheck.initialize({ provider: Capacitor.getPlatform() === 'web' ? new ReCaptchaV3Provider('myKey') : undefined, }); }; ``` ```APIDOC ## Get App Check Token ### Description Retrieves the current App Check token. ### Method Signature `FirebaseAppCheck.getToken(options?: { forceRefresh?: boolean })` ### Parameters - `options` (object) - Optional. Options for retrieving the token. - `forceRefresh` (boolean) - Optional. If true, forces a refresh of the token. Defaults to false. ### Returns - `Promise<{ token: string }>` - A promise that resolves with the App Check token. ### Example ```typescript const getToken = async () => { const { token } = await FirebaseAppCheck.getToken({ forceRefresh: false, }); return token; }; ``` ```APIDOC ## Set Token Auto Refresh ### Description Enables or disables automatic token auto-refresh. ### Method Signature `FirebaseAppCheck.setTokenAutoRefreshEnabled(options: { enabled: boolean })` ### Parameters - `options` (object) - Required. Configuration for auto-refresh. - `enabled` (boolean) - Required. Set to true to enable auto-refresh, false to disable. ### Example ```typescript await FirebaseAppCheck.setTokenAutoRefreshEnabled({ enabled: true }); ``` ```APIDOC ## Add Token Changed Listener ### Description Adds a listener that is called when the App Check token changes. ### Method Signature `FirebaseAppCheck.addListener(eventName: 'tokenChanged', listenerFunc: (event: { token: string }) => void)` ### Parameters - `eventName` ('tokenChanged') - The name of the event to listen for. - `listenerFunc` (function) - The callback function to execute when the token changes. It receives an event object with the new token. ### Example ```typescript await FirebaseAppCheck.addListener('tokenChanged', event => { console.log('tokenChanged', { event }); }); ``` ```APIDOC ## Remove All Listeners ### Description Removes all listeners for the FirebaseAppCheck plugin. ### Method Signature `FirebaseAppCheck.removeAllListeners()` ### Example ```typescript await FirebaseAppCheck.removeAllListeners(); ``` -------------------------------- ### Install Previous Version for Capacitor 4 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/analytics/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/analytics@1.4.0 ``` -------------------------------- ### Install Previous Version for Capacitor 4 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/app-check@1.4.0 ``` -------------------------------- ### Install SwiftLint on macOS Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/CONTRIBUTING.md If you are developing on macOS, install SwiftLint using Homebrew to enforce Swift code style. ```shell brew install swiftlint ``` -------------------------------- ### Install Previous Version for Capacitor 4 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. Ensure your project meets Capacitor 5 requirements before upgrading. ```bash npm i @capacitor-firebase/performance@1.4.0 ``` -------------------------------- ### startTrace Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Starts a trace with the given options. Traces are used to group related operations for performance analysis. ```APIDOC ## startTrace(...) ### Description Starts a trace. ### Method startTrace ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **`options`** (StartTraceOptions) - Required - Options for starting a trace. ### Request Example ```json { "traceId": "my-trace-id" } ``` ### Response #### Success Response (void) This method returns a void promise. #### Response Example None ``` -------------------------------- ### signInWithGoogle Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the Google sign-in flow. This method initiates the OAuth process for Google authentication. ```APIDOC ## signInWithGoogle ### Description Starts the Google sign-in flow. ### Method ```typescript signInWithGoogle(options?: SignInWithGoogleOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithGoogleOptions) - Optional - Configuration options for the sign-in flow. ``` -------------------------------- ### Install Older Version for Capacitor 4 Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/authentication@1.4.0 ``` -------------------------------- ### Example Debug Secret Output Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/README.md This is an example of the output you should expect when running the adb logcat command to capture the debug secret. ```text D DebugAppCheckProvider: Enter this debug secret into the allow list in the Firebase Console for your project: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ``` -------------------------------- ### signInWithMicrosoft Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the Microsoft sign-in flow. This method initiates the OAuth process for Microsoft authentication. ```APIDOC ## signInWithMicrosoft ### Description Starts the Microsoft sign-in flow. ### Method ```typescript signInWithMicrosoft(options?: SignInWithOAuthOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOAuthOptions) - Optional - Configuration options for the sign-in flow. ``` -------------------------------- ### signInWithGithub Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the GitHub sign-in flow. This method initiates the OAuth process for GitHub authentication. ```APIDOC ## signInWithGithub ### Description Starts the GitHub sign-in flow. ### Method ```typescript signInWithGithub(options?: SignInWithOAuthOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOAuthOptions) - Optional - Configuration options for the sign-in flow. ``` -------------------------------- ### RecordOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Options for recording a trace. Includes trace name, start time, duration, and optional metrics/attributes. ```APIDOC ## RecordOptions ### Description Options for recording a trace. ### Properties - **`traceName`** (string) - Name of the trace to record. - **`startTime`** (number) - Start time of the trace since epoch in milliseconds. - **`duration`** (number) - The duration of the trace in milliseconds. - **`options`** ({ metrics?: { [key: string]: number; }; attributes?: { [key: string]: string; }; }) - An optional object that holds optional maps of custom metrics and attributes. ``` -------------------------------- ### signOut Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the sign-out flow for the current user. ```APIDOC ## signOut() ### Description Starts the sign-out flow. ### Method `signOut()` ### Returns `Promise` ``` -------------------------------- ### Start and Stop Traces Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Use `startTrace` to begin monitoring a specific operation and `stopTrace` to end it. Ensure traces are properly named for identification. ```typescript import { FirebasePerformance } from '@capacitor-firebase/performance'; const startTrace = async () => { await FirebasePerformance.startTrace({ traceName: 'test_trace' }); }; const stopTrace = async () => { await FirebasePerformance.stopTrace({ traceName: 'test_trace' }); }; ``` -------------------------------- ### signInWithGameCenter Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the sign-in flow using Game Center. This method is only available on iOS. ```APIDOC ## signInWithGameCenter(...) ### Description Starts the Game Center sign-in flow. Only available for iOS. ### Method ```typescript signInWithGameCenter(options?: SignInWithOAuthOptions | SignInOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOAuthOptions | SignInOptions) - Optional - Options for the Game Center sign-in flow. ### Response #### Success Response (SignInResult) Returns a Promise that resolves with the sign-in result. ### Response Example ```json { "example": "SignInResult" } ``` ``` -------------------------------- ### signInWithPlayGames Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the Play Games sign-in flow. This method is specifically for Android devices. ```APIDOC ## signInWithPlayGames ### Description Starts the Play Games sign-in flow. Only available for Android. ### Method ```typescript signInWithPlayGames(options?: SignInWithOAuthOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOAuthOptions) - Optional - Configuration options for the sign-in flow. ``` -------------------------------- ### signInWithCustomToken Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the sign-in flow using a custom authentication token. Note: This method has limitations with `skipNativeAuth` on Android and iOS. ```APIDOC ## signInWithCustomToken(...) ### Description Starts the Custom Token sign-in flow. This method cannot be used in combination with `skipNativeAuth` on Android and iOS. In this case you have to use the `signInWithCustomToken` interface of the Firebase JS SDK directly. ### Method ```typescript signInWithCustomToken(options: SignInWithCustomTokenOptions) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithCustomTokenOptions) - Required - The options object containing the custom token. ### Response #### Success Response (SignInResult) Returns a Promise that resolves with the sign-in result. ### Response Example ```json { "example": "SignInResult" } ``` ``` -------------------------------- ### signInWithEmailAndPassword Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the sign-in flow using a user's email address and password. ```APIDOC ## signInWithEmailAndPassword(...) ### Description Starts the sign-in flow using an email and password. ### Method ```typescript signInWithEmailAndPassword(options: SignInWithEmailAndPasswordOptions) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithEmailAndPasswordOptions) - Required - The options object containing the email and password. ### Response #### Success Response (SignInResult) Returns a Promise that resolves with the sign-in result. ### Response Example ```json { "example": "SignInResult" } ``` ``` -------------------------------- ### initialize Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/README.md Activate App Check for the given app. This method should be called only once per app and requires initialization options. ```APIDOC ## initialize ### Description Activate App Check for the given app. Can be called only once per app. ### Method ```typescript initialize(options?: InitializeOptions | undefined) => Promise ``` ### Parameters #### Query Parameters - **`options`** (InitializeOptions) - Optional. Configuration for initializing App Check. ### Since 1.3.0 ``` -------------------------------- ### InitializeOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/app-check/README.md Options for initializing the App Check service. ```APIDOC ## InitializeOptions ### Description Options for initializing the App Check service. ### Properties #### `debug` (boolean) - Optional - If `true`, the debug provider is used. Deprecated: Use `debugToken` instead. #### `debugToken` (string | boolean) - Optional - If `true`, the debug provider is used. On Web, you can also set a predefined debug token string instead of `true`. On Android and iOS, you have to use environment variables for this. #### `isTokenAutoRefreshEnabled` (boolean) - Optional - If `true`, the SDK automatically refreshes App Check tokens as needed. #### `provider` (any) - Optional - The provider to use for App Check. Must be an instance of `ReCaptchaV3Provider`, `ReCaptchaEnterpriseProvider`, or `CustomProvider`. Only available for Web. #### `siteKey` (string) - Optional - The reCAPTCHA v3 site key (public key). This option is ignored when `provider` is set. Only available for Web. ``` -------------------------------- ### Install Older Version of Remote Config Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/remote-config/BREAKING.md If you need to use this plugin with Capacitor 4, install version 1.4.0. ```bash npm i @capacitor-firebase/remote-config@1.4.0 ``` -------------------------------- ### signInWithOpenIdConnect Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the OpenID Connect sign-in flow. This method is used for authentication via OpenID Connect providers. ```APIDOC ## signInWithOpenIdConnect ### Description Starts the OpenID Connect sign-in flow. ### Method ```typescript signInWithOpenIdConnect(options: SignInWithOpenIdConnectOptions) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOpenIdConnectOptions) - Required - Configuration options for the OpenID Connect sign-in flow. ``` -------------------------------- ### Fetch and Activate Remote Config Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/remote-config/README.md Fetches the latest Remote Config and activates it. This is a convenient method to get the most up-to-date configuration and make it available. ```APIDOC ## fetchAndActivate ### Description Fetches the latest Remote Config and activates it. ### Method ```typescript FirebaseRemoteConfig.fetchAndActivate(); ``` ### Returns * `Promise` ``` -------------------------------- ### Sign in with Google Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Initiates the sign-in process using Google authentication. Returns the authenticated user object. ```APIDOC ## signInWithGoogle ### Description Initiates the sign-in process using Google authentication. Returns the authenticated user object. ### Method ```javascript FirebaseAuthentication.signInWithGoogle() ``` ### Response #### Success Response - **user** (object) - The authenticated user object. ``` -------------------------------- ### activate() Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/remote-config/README.md Makes the last fetched configuration available to the getters. Available since version 1.3.0. ```APIDOC ## activate() ### Description Make the last fetched configuration available to the getters. ### Method activate() ### Returns Promise ### Since 1.3.0 ``` -------------------------------- ### Initialize Facebook SDK in AppDelegate.swift (iOS) Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/docs/setup-facebook.md Update the `application(_:didFinishLaunchingWithOptions:)` function in your AppDelegate.swift to initialize the Facebook SDK. ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + ApplicationDelegate.shared.application( + application, + didFinishLaunchingWithOptions: launchOptions + ) return true } ``` -------------------------------- ### UseEmulatorOptions Interface Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/functions/README.md Options for configuring the emulator. ```APIDOC ## UseEmulatorOptions Interface ### Description Options for configuring the emulator. ### Properties #### `host` - **`host`** (string) - The emulator host without any port or scheme. Note when using a Android Emulator device: 10.0.2.2 is the special IP address to connect to the 'localhost' of the host computer. #### `port` - **`port`** (number) - The emulator port. Defaults to `5001`. #### `regionOrCustomDomain` - **`regionOrCustomDomain`** (string) - The region the callable functions are located in or a custom domain hosting the callable functions. ### Since 6.1.0 ``` -------------------------------- ### InitiateOnDeviceConversionMeasurementWithEmailAddressOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/analytics/README.md Options for initiating on-device conversion measurement with an email address. ```APIDOC ## InitiateOnDeviceConversionMeasurementWithEmailAddressOptions ### Description Options for initiating on-device conversion measurement with an email address. ### Properties - **`emailAddress`** (string) - Required - The email address to initiate on-device conversion measurement with. ``` -------------------------------- ### SignInWithEmailLinkOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for signing in with an email link. ```APIDOC ## SignInWithEmailLinkOptions ### Description Signs in a user using an email link. ### Parameters #### Request Body - **`email`** (string) - Required - The user's email address. - **`emailLink`** (string) - Required - The link sent to the user's email address. ``` -------------------------------- ### Sign in with Microsoft Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Initiates the sign-in process using Microsoft authentication. Returns the authenticated user object. ```APIDOC ## signInWithMicrosoft ### Description Initiates the sign-in process using Microsoft authentication. Returns the authenticated user object. ### Method ```javascript FirebaseAuthentication.signInWithMicrosoft() ``` ### Response #### Success Response - **user** (object) - The authenticated user object. ``` -------------------------------- ### getTenantId Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Get the tenant id. ```APIDOC ## getTenantId() ### Description Get the tenant id. ### Method ```typescript getTenantId() => Promise ``` ``` -------------------------------- ### GetIdTokenOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for getting an ID token. ```APIDOC ## GetIdTokenOptions ### Description Configuration options for the `getIdToken` method. ### Properties - **`forceRefresh`** (boolean) - Optional - Force refresh regardless of token expiration. ``` -------------------------------- ### GetCountFromServerOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Options for getting a count from the server. ```APIDOC ## GetCountFromServerOptions ### Description Options for specifying the reference when getting a count from the server. ### Properties - **`reference`** (string) - Required - The reference as a string, with path components separated by a forward slash (`/`). ``` -------------------------------- ### GetTenantIdResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Represents the result of getting the tenant ID. ```APIDOC ## GetTenantIdResult ### Description Contains the tenant ID associated with the current authentication context. ### Properties - **`tenantId`** (string | null) - The tenant id. `null` if it has never been set. ``` -------------------------------- ### Sign In with Email and Password Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Signs the user in using their email address and password. Requires a pre-existing account created with `createUserWithEmailAndPassword` or similar. ```typescript import { FirebaseAuthentication } from '@capacitor-firebase/authentication'; const signInWithEmailAndPassword = async () => { const result = await FirebaseAuthentication.signInWithEmailAndPassword({ email: 'mail@example.com', password: '1234', }); return result.user; }; ``` -------------------------------- ### CreateUserWithEmailAndPasswordOptions Structure Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for creating a new user with an email address and password. ```APIDOC ## CreateUserWithEmailAndPasswordOptions ### Description Options for creating a new user with email and password. ### Properties - **`email`** (string) - The email address of the new user. - **`password`** (string) - The password for the new user. ``` -------------------------------- ### GetIdTokenResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Represents the result of getting an ID token. ```APIDOC ## GetIdTokenResult ### Description Contains the Firebase Auth ID token. ### Properties - **`token`** (string) - The Firebase Auth ID token JWT string. ``` -------------------------------- ### GetCurrentUserResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Represents the result of getting the current user. ```APIDOC ## GetCurrentUserResult ### Description Contains the currently authenticated user object. ### Properties - **`user`** (User | null) - The currently signed-in user, or null if there isn't any. ``` -------------------------------- ### GetCountFromServerResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Result object for getting a count from the server. ```APIDOC ## GetCountFromServerResult ### Description Contains the count of documents in a collection or query. ### Properties - **`count`** (number) - The number of documents in the collection. ``` -------------------------------- ### GetMetadataOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Options for getting a file's metadata. ```APIDOC ## GetMetadataOptions ### Description Options for getting a file's metadata. ### Properties #### Path Parameters None #### Query Parameters None #### Request Body - **`path`** (string) - Required - The full path to the file to get the metadata for, including the file name. ``` -------------------------------- ### Sign in with OpenIdConnect Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Initiates the sign-in process using OpenID Connect. Requires a provider ID. Returns the authenticated user object. ```APIDOC ## signInWithOpenIdConnect ### Description Initiates the sign-in process using OpenID Connect. Requires a provider ID. Returns the authenticated user object. ### Method ```javascript FirebaseAuthentication.signInWithOpenIdConnect({ providerId: 'oidc.example.com' }) ``` ### Parameters #### Request Body - **providerId** (string) - Required - The OpenID Connect provider ID. ### Response #### Success Response - **user** (object) - The authenticated user object. ``` -------------------------------- ### UseEmulatorOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Options for connecting to a Firestore emulator. Specify the host and port for the emulator. ```APIDOC ## UseEmulatorOptions ### Description Options to configure the connection to a Firestore emulator. ### Parameters #### Request Body - **`host`** (string) - Optional - The emulator host without any port or scheme. Note when using an Android Emulator device: 10.0.2.2 is the special IP address to connect to the 'localhost' of the host computer. - **`port`** (number) - Optional - The emulator port. Defaults to `8080`. ``` -------------------------------- ### GetMetadataResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Result of getting a file's metadata. ```APIDOC ## GetMetadataResult ### Description Result of getting a file's metadata. ### Properties #### Response Body - **`bucket`** (string) - The bucket this file is contained in. - **`createdAt`** (number) - The timestamp at which the file was created in milliseconds since the epoch. - **`generation`** (string) - The object's generation. - **`md5Hash`** (string) - The md5 hash of the file. - **`metadataGeneration`** (string) - The object's metadata generation. - **`name`** (string) - The short name of this file, which is the last component of the full path. - **`path`** (string) - The full path to the file, including the file name. - **`size`** (number) - The size of the file in bytes. - **`updatedAt`** (number) - The timestamp at which the file was last updated in milliseconds since the epoch. - **`cacheControl`** (string) - Served as the `Cache-Control` header on object download. - **`contentDisposition`** (string) - Served as the `Content-Disposition` header on object download. - **`contentEncoding`** (string) - Served as the `Content-Encoding` header on object download. - **`contentLanguage`** (string) - Served as the `Content-Language` header on object download. - **`contentType`** (string) - Served as the `Content-Type` header on object download. - **`customMetadata`** ({ [key: string]: string; }) - Additional user-defined custom metadata. ``` -------------------------------- ### Stop a Trace Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Stops a previously started performance trace. ```APIDOC ## stopTrace ### Description Stops a previously started performance trace. ### Method `FirebasePerformance.stopTrace` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace to stop. ### Request Example ```typescript await FirebasePerformance.stopTrace({ traceName: 'test_trace' }); ``` ``` -------------------------------- ### Create User with Email and Password Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Creates a new user account with the provided email and password. This method returns the newly created user object upon success. ```typescript import { FirebaseAuthentication } from '@capacitor-firebase/authentication'; const createUserWithEmailAndPassword = async () => { const result = await FirebaseAuthentication.createUserWithEmailAndPassword({ email: 'mail@exmaple.com', password: '1234', }); return result.user; }; ``` -------------------------------- ### Get Tenant ID Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Retrieves the current tenant ID. ```typescript getTenantId() => Promise ``` -------------------------------- ### useEmulator Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Instrument your app to talk to the Authentication emulator. ```APIDOC ## useEmulator(options: UseEmulatorOptions) ### Description Instrument your app to talk to the Authentication emulator. ### Method `useEmulator(options: UseEmulatorOptions)` ### Parameters #### Request Body - **options** (UseEmulatorOptions) - Required - Options for connecting to the emulator. ``` -------------------------------- ### GetDownloadUrlOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Options for getting a file's download URL. ```APIDOC ## GetDownloadUrlOptions ### Description Options for getting a file's download URL. ### Properties #### Path Parameters None #### Query Parameters None #### Request Body - **`path`** (string) - Required - The full path to the file to get the download url for, including the file name. ``` -------------------------------- ### UseEmulatorOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Options for configuring the connection to a Firebase Storage emulator. ```APIDOC ## UseEmulatorOptions ### Description Configuration options for connecting to a local Firebase Storage emulator. ### Properties - **`host`** (string) - Required - The emulator host without any port or scheme. Note when using a Android Emulator device: 10.0.2.2 is the special IP address to connect to the 'localhost' of the host computer. - **`port`** (number) - Required - The emulator port. Defaults to 9199. ``` -------------------------------- ### GetDownloadUrlResult Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Result of getting a file's download URL. ```APIDOC ## GetDownloadUrlResult ### Description Result of getting a file's download URL. ### Properties #### Response Body - **`downloadUrl`** (string) - The download url for the file. ``` -------------------------------- ### Enable Facebook in variables.gradle Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/docs/setup-facebook.md Add this configuration to your `variables.gradle` file to enable Facebook integration. Run `npx cap update` afterwards. ```diff ext { rgcfaIncludeFacebook = true } ``` -------------------------------- ### Get Delivered Notifications Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/README.md Retrieves a list of delivered notifications. ```APIDOC ## getDeliveredNotifications ### Description Retrieves a list of delivered notifications. ### Method FirebaseMessaging.getDeliveredNotifications() ### Returns - Promise<{ notifications: Array<{ id: string }> }>: A promise that resolves with an array of delivered notification objects, each with an `id`. ``` -------------------------------- ### Get Token Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/messaging/README.md Retrieves the FCM registration token for the device. ```APIDOC ## getToken ### Description Retrieves the FCM registration token for the device. ### Method FirebaseMessaging.getToken() ### Returns - Promise<{ token: string }>: A promise that resolves with an object containing the FCM token. ``` -------------------------------- ### Create User with Email and Password Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Creates a new user account using email and password. The user is automatically signed in upon successful creation. Requires `CreateUserWithEmailAndPasswordOptions`. ```typescript createUserWithEmailAndPassword(options: CreateUserWithEmailAndPasswordOptions) => Promise ``` -------------------------------- ### Get Metric Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Retrieves a specific custom metric from a trace. ```APIDOC ## getMetric ### Description Retrieves a specific custom metric from a trace. ### Method `FirebasePerformance.getMetric` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace. - **metricName** (string) - Required - The name of the metric to retrieve. ### Response #### Success Response (200) - **value** (number) - The value of the requested metric. ### Response Example ```json { "value": 1 } ``` ### Request Example ```typescript const result = await FirebasePerformance.getMetric({ traceName: 'test_trace', metricName: 'item_cache_hit', }); return result.value; ``` ``` -------------------------------- ### Get Document Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Retrieves a single document at the specified reference. ```APIDOC ## getDocument ### Description Retrieves a single document at the specified reference. ### Method `FirebaseFirestore.getDocument(options: { reference: string; }): Promise<{ snapshot: any }>` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **reference** (string) - Required - The path to the document. ### Request Example ```typescript const { snapshot } = await FirebaseFirestore.getDocument({ reference: 'users/Aorq09lkt1ynbR7xhTUx', }); ``` ### Response #### Success Response (200) - **snapshot** (any) - The document snapshot. #### Response Example ```json { "snapshot": { ... } } ``` ``` -------------------------------- ### SignInWithCustomTokenOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for signing in with a custom token. ```APIDOC ## SignInWithCustomTokenOptions ### Description Signs in a user using a custom authentication token. ### Parameters #### Request Body - **`token`** (string) - Required - The custom token to sign in with. ``` -------------------------------- ### Fetch Sign-in Methods for Email Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Fetches the available sign-in methods for a given email address. Requires `FetchSignInMethodsForEmailOptions`. ```typescript fetchSignInMethodsForEmail(options: FetchSignInMethodsForEmailOptions) => Promise ``` -------------------------------- ### Get Attributes Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Retrieves all custom attributes associated with a trace. ```APIDOC ## getAttributes ### Description Retrieves all custom attributes associated with a trace. ### Method `FirebasePerformance.getAttributes` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace. ### Response #### Success Response (200) - **attributes** (object) - An object containing all custom attributes for the trace. ### Response Example ```json { "attributes": { "user_id": "123" } } ``` ### Request Example ```typescript const result = await FirebasePerformance.getAttributes({ traceName: 'test_trace' }); return result.attributes; ``` ``` -------------------------------- ### Get Attribute Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Retrieves a specific custom attribute from a trace. ```APIDOC ## getAttribute ### Description Retrieves a specific custom attribute from a trace. ### Method `FirebasePerformance.getAttribute` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace. - **attribute** (string) - Required - The name of the attribute to retrieve. ### Response #### Success Response (200) - **attributes** (object) - An object containing the requested attribute and its value. ### Response Example ```json { "attributes": { "user_id": "123" } } ``` ### Request Example ```typescript const result = await FirebasePerformance.getAttribute({ traceName: 'test_trace', attribute: 'user_id', }); return result.attributes; ``` ``` -------------------------------- ### Sign in with Google Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Initiates the sign-in flow using Google authentication. Returns the user object upon successful authentication. ```typescript const signInWithGoogle = async () => { const result = await FirebaseAuthentication.signInWithGoogle(); return result.user; }; ``` -------------------------------- ### QueryStartAtConstraint Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Represents a constraint to start a query at or after a specific document reference. ```APIDOC ## QueryStartAtConstraint ### Description Specifies the starting point for a query, either at or after a given document reference. ### Properties - **`type`** ('startAt' | 'startAfter') - Required - The type of the constraint. - **`reference`** (string) - Required - The reference to start at or after as a string, with path components separated by a forward slash (`/`). **Attention**: This requires an additional document read. ``` -------------------------------- ### Get Current User Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Fetches the details of the currently signed-in user. ```typescript getCurrentUser() => Promise ``` -------------------------------- ### Get Collection Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/firestore/README.md Retrieves documents from a collection with optional filtering and ordering. ```APIDOC ## getCollection ### Description Retrieves documents from a collection with optional filtering and ordering. ### Method `FirebaseFirestore.getCollection(options: { reference: string; queryConstraints?: any[]; compositeFilter?: any; }): Promise<{ snapshots: any[] }>;` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **reference** (string) - Required - The path to the collection. - **queryConstraints** (array) - Optional - An array of query constraints like orderBy and limit. - **type** (string) - Required - The type of constraint ('orderBy', 'limit'). - **fieldPath** (string) - Required for 'orderBy' - The field to order by. - **directionStr** (string) - Optional for 'orderBy' - The direction ('asc' or 'desc'). Defaults to 'asc'. - **limit** (number) - Required for 'limit' - The maximum number of documents to return. - **compositeFilter** (object) - Optional - A composite filter to apply to the query. - **type** (string) - Required - The type of composite filter ('and', 'or'). - **queryConstraints** (array) - Required - An array of query constraints. - **type** (string) - Required - The type of constraint ('where'). - **fieldPath** (string) - Required - The field to filter on. - **opStr** (string) - Required - The comparison operator ('==', '<', '<=', '>', '>=', 'array-contains', 'in', 'not-in', 'array-contains-any'). - **value** (any) - Required - The value to compare against. ### Request Example ```typescript const { snapshots } = await FirebaseFirestore.getCollection({ reference: 'users', compositeFilter: { type: 'and', queryConstraints: [ { type: 'where', fieldPath: 'born', opStr: '==', value: 1912, }, ], }, queryConstraints: [ { type: 'orderBy', fieldPath: 'born', directionStr: 'desc', }, { type: 'limit', limit: 10, }, ], }); ``` ### Response #### Success Response (200) - **snapshots** (array) - An array of document snapshots. #### Response Example ```json { "snapshots": [ { ... }, { ... } ] } ``` ``` -------------------------------- ### Get Metadata Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/storage/README.md Retrieves the metadata for a file in Firebase Cloud Storage. ```APIDOC ## getMetadata ### Description Retrieves the metadata for a file. ### Method Signature `FirebaseStorage.getMetadata(options: { path: string }): Promise` ### Parameters #### Options - **path** (string) - Required - The path of the file in Firebase Storage. ### Response #### Success Response (200) - **Metadata** - An object containing the file's metadata. - **contentType** (string) - The content type of the file. - **customMetadata** (object) - Any custom metadata associated with the file. - **size** (number) - The size of the file in bytes. - **updated** (Date) - The last updated timestamp. - **generation** (string) - The generation ID of the file. - **metageneration** (string) - The metageneration ID of the file. ### Request Example ```typescript const result = await FirebaseStorage.getMetadata({ path: 'images/mountains.png', }); console.log(result); ``` ``` -------------------------------- ### Sign Out User Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Starts the sign-out flow for the current user. Available since 0.1.0. ```typescript signOut() => Promise ``` -------------------------------- ### UseEmulatorOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for connecting to the Firebase emulator. ```APIDOC ## UseEmulatorOptions ### Description Options for connecting to the Firebase emulator. ### Properties - **`host`** (string) - Optional - The emulator host without any port or scheme. - **`port`** (number) - Optional - The emulator port. Defaults to `9099`. - **`scheme`** (string) - Optional - The emulator scheme. Only available for Web. Defaults to `"http"`. ``` -------------------------------- ### signInWithApple Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Initiates the sign-in flow using Apple as the authentication provider. ```APIDOC ## signInWithApple(...) ### Description Starts the Apple sign-in flow. ### Method ```typescript signInWithApple(options?: SignInWithOAuthOptions | undefined) => Promise ``` ### Parameters #### Path Parameters - **options** (SignInWithOAuthOptions) - Optional - Options for the Apple sign-in flow. ### Response #### Success Response (SignInResult) Returns a Promise that resolves with the sign-in result. ### Response Example ```json { "example": "SignInResult" } ``` ``` -------------------------------- ### Fetch Sign-In Methods for Email Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Fetches the sign-in methods available for a given email address. This can be used to determine if an email is associated with an existing account and which providers are enabled. ```typescript import { FirebaseAuthentication } from '@capacitor-firebase/authentication'; const fetchSignInMethodsForEmail = async () => { const result = await FirebaseAuthentication.fetchSignInMethodsForEmail({ email: 'mail@example.tld', }); return result.signInMethods; }; ``` -------------------------------- ### Record a Trace Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/README.md Records a trace with specified start time, duration, metrics, and attributes. ```APIDOC ## record ### Description Records a trace with specified start time, duration, metrics, and attributes. ### Method `FirebasePerformance.record` ### Parameters #### Path Parameters - **traceName** (string) - Required - The name of the trace to record. - **startTime** (number) - Required - The start time of the trace in milliseconds since the epoch. - **duration** (number) - Required - The duration of the trace in milliseconds. - **options** (object) - Optional - An object containing metrics and attributes for the trace. - **metrics** (object) - Optional - A key-value map of metrics. - **attributes** (object) - Optional - A key-value map of attributes. ### Request Example ```typescript await FirebasePerformance.record({ traceName: 'test_trace', startTime: Date.now(), duration: 1000, options: { metrics: { item_cache_hit: 1, }, attributes: { user_id: '123', }, }, }); ``` ``` -------------------------------- ### SignInWithEmailAndPasswordOptions Source: https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/authentication/README.md Options for signing in with email and password. ```APIDOC ## SignInWithEmailAndPasswordOptions ### Description Signs in a user using their email address and password. ### Parameters #### Request Body - **`email`** (string) - Required - The user's email address. - **`password`** (string) - Required - The user's password. ```