Anleitung
Firebase Functions in Capacitor nutzen
Verwendung von @capgo/capacitor-firebase-functions
Capacitor Plugin für Firebase Cloud Functions.
Installieren
bun add @capgo/capacitor-firebase-functions
bunx cap sync
bunx cap sync kopiert den nativen code des Plugins in deine nativen Projekte. Nach jedem Plugin-Upgrade erneut ausführen.
Importieren
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
API auf einen Blick
| Methode | Beschreibung |
|---|---|
callByName |
Rufe eine callable Function über den Namen auf. |
callByUrl |
Rufe eine callable Function über die URL auf. |
useEmulator |
Instrumentiere deine App für die Kommunikation mit dem Cloud Functions Emulator. |
Beispiele
callByName()
Rufe eine callable Function über den Namen auf.
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
const result = await FirebaseFunctions.callByName({ name: 'myFunction' });
console.log(result);
callByUrl()
Rufe eine callable Function über die URL auf.
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
const result = await FirebaseFunctions.callByUrl({
url: 'https://us-central1-my-project.cloudfunctions.net/myFunction',
});
console.log(result);
useEmulator()
Instrumentiere deine App für die Kommunikation mit dem Cloud Functions Emulator.
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
await FirebaseFunctions.useEmulator({ host: "127.0.0.1" });
Vollständige Referenz
Weiterlesen nach „Verwendung von @capgo/capacitor-firebase-functions“
Wenn du es nutzt Verwendung von @capgo/capacitor-firebase-functions Um die Arbeit an nativen Plugins zu planen, verbinde sie mit Capgo Plugin-Verzeichnis für den Produkt-Workflow im Capgo Plugin-Verzeichnis, Capacitor Plugins von Capgo für das Implementierungsdetail in Capacitor Plugins von Capgo, Plugins hinzufügen oder aktualisieren für die Implementierungsdetails unter „Plugins hinzufügen oder aktualisieren“, Ionic Enterprise Plugin-Alternativen für den Produkt-Workflow in Ionic Enterprise Plugin-Alternativen und Capgo Native Builds für den Produkt-Workflow in Capgo Native Builds.