Capgo에서 __CAPGO_KEEP_0__ 보러 가기
설명서
@capgo/capacitor-health 사용
Capacitor 플러그인을 사용하여 애플 헬스 키트 및 헬스 커넥트에서 데이터와 상호 작용합니다.
설치
bun add @capgo/capacitor-health
bunx cap sync
이 플러그인이 노출하는 것
isAvailable- 현재 플랫폼이 네이티브 헬스 SDK를 지원하는지 여부를 반환합니다.requestAuthorization- 제공된 데이터 유형에 대한 읽기/쓰기 접근을 요청합니다.checkAuthorization- 사용자에게提示하지 않고 제공된 데이터 유형에 대한 인증 상태를 확인합니다.readSamples- 지정된 시간 범위 내에서 지정된 데이터 유형의 샘플을 읽습니다.
예시 사용
isAvailable
- 현재 플랫폼이 네이티브 헬스 SDK를 지원하는지 여부를 반환합니다.
import { Health } from '@capgo/capacitor-health';
await Health.isAvailable();
requestAuthorization
제공된 데이터 유형에 대한 읽기/쓰기 접근 권한을 읽습니다.
import { Health } from '@capgo/capacitor-health';
await Health.requestAuthorization({} as AuthorizationOptions);
checkAuthorization
사용자에게 알리지 않고 제공된 데이터 유형에 대한 인증 상태를 확인합니다.
import { Health } from '@capgo/capacitor-health';
await Health.checkAuthorization({} as AuthorizationOptions);
readSamples
지정된 시간 범위 내에서 지정된 데이터 유형의 샘플을 읽습니다.
import { Health } from '@capgo/capacitor-health';
await Health.readSamples({} as QueryOptions);
전체 참조
- GitHub: github.com/Cap-go/capacitor-health
- 문서: /docs/plugins/health/
Using @capgo/capacitor-health에서 계속 진행하세요.
이 기능을 사용하는 경우 Using @capgo/capacitor-health 자연 플러그인 작업을 계획하는 경우 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-health와 연결하세요. @capgo/capacitor-health for the implementation detail in @capgo/capacitor-health, 시작하기 Capacitor-__CAPGO_KEEP_0__-health Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and 푸터 __CAPGO_KEEP_0__ 앱을 __CAPGO_KEEP_0__로 güç화하세요