가이드
Capacitor에서 파이어베이스 함수를 사용하는 방법
@capgo/capacitor-파이어베이스-함수
Capacitor 파이어베이스 클라우드 함수 플러그인
설치
bun add @capgo/capacitor-firebase-functions
bunx cap sync
bunx cap sync 플러그인의 네이티브 code을 프로젝트에 복사하고, 플러그인 업그레이드 후 다시 실행합니다.
수입
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
API의 개요
| 방법 | 설명 |
|---|---|
callByName |
명령형 함수를 이름으로 호출합니다. |
callByUrl |
URL로 명령형 함수를 호출합니다. |
useEmulator |
앱을 클라우드 함수 에뮬레이터와 통신하기 위해 인스트루먼트합니다. |
예제
callByName()
명령형 함수를 이름으로 호출합니다.
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
const result = await FirebaseFunctions.callByName({ name: 'myFunction' });
console.log(result);
callByUrl()
URL로 명령형 함수를 호출합니다.
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()
앱을 클라우드 함수 에뮬레이터와 통신하기 위해 인스트루먼트합니다.
import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';
await FirebaseFunctions.useEmulator({ host: "127.0.0.1" });
역할: 섹션 또는 페이지 제목. 페이지: bug-bounty.astro. 메시지 키: bug_bounty_supabase_examples_title (Bug Bounty Supabase Examples Title).
Keep going from Using @capgo/capacitor-firebase-functions
__CAPGO_KEEP_0__ 사용하기 @capgo/capacitor-firebase-함수 __CAPGO_KEEP_0__ 플러그인 디렉토리 Capgo 플러그인 Capgo 플러그인 Capacitor Capgo 플러그인 Capacitor 플러그인에 대한 구현 세부 사항은 Capgo에 의해 제공됩니다. __CAPGO_KEEP_0__ reference 구현 세부 정보에 대한 Adding or Updating Plugins에 대해 Enterprise Ionic Plugin Alternatives 구현 세부 정보에 대한 Ionic Enterprise Plugin Alternatives에 대해, 그리고 Capgo Native Builds에 대해 구현 세부 정보에 대한 Capgo Native Builds에 대해.