Getting Started
설치 단계와 전체 마크다운 가이드를 포함한 플러그인 설정 지시문을 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-photo-library`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/photo-library/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음 명령어를 사용하여 플러그인을 설치하고 플랫폼에 따라 다음 지침을 따르세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-photo-library` plugin in my project.설치, 동기화 및 소스 마크다운 가이드가 포함됩니다.
bun add @capgo/capacitor-photo-librarybunx cap syncimport { PhotoLibrary } from '@capgo/capacitor-photo-library';API 개요
‘API 개요’ 제목의 섹션checkAuthorization
인증 확인사용자에게 인증을 요청하지 않고 현재 인증 상태를 반환합니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.checkAuthorization();requestAuthorization
‘인증 요청’ 제목의 섹션사진 앨범에 접근할 필요가 있는 경우 접근 권한을 요청합니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.requestAuthorization();getAlbums
getAlbums 제목가용 앨범을 가져옵니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getAlbums();getLibrary
getLibrary 제목웹 뷰에서 표시할 수 있는 URL을 포함한 라이브러리 자산을 가져옵니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getLibrary();getPhotoUrl
getPhotoUrl 제목전체 해상도 버전의 자산에 대한 표시할 수 있는 URL을 가져옵니다.
이미 getLibrary with includeFullResolutionData, you normally
do not need this method.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getPhotoUrl({} as { id: string });getThumbnailUrl
getThumbnailUrl 섹션자산의 리사이즈된 썸네일의 표시 가능한 URL을 가져옵니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getThumbnailUrl({} as { id: string; width?: number; height?: number; quality?: number; });pickMedia
pickMedia 섹션사진 앨범에 대한 전체 접근 권한을 부여하지 않고 사용자가 미디어를 선택할 수 있도록 시스템 내부 픽커를 열립니다. 선택된 파일은 애플리케이션 캐시에 복사되고 포트러블 URL과 함께 반환됩니다.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.pickMedia();타입 참조
타입 참조 섹션PhotoLibraryAuthorizationState
PhotoLibraryAuthorizationState 섹션export type PhotoLibraryAuthorizationState = 'authorized' | 'limited' | 'denied' | 'notDetermined';PhotoLibraryAlbum
PhotoLibraryAlbum 섹션export interface PhotoLibraryAlbum { id: string; title: string; assetCount: number;}GetLibraryOptions
라이브러리 옵션 가져오기export interface GetLibraryOptions { /** * Number of assets to skip from the beginning of the query. */ offset?: number; /** * Maximum number of assets to return. Omit to return everything that matches. */ limit?: number; /** * Include images in the result. Defaults to `true`. */ includeImages?: boolean; /** * Include videos in the result. Defaults to `false`. */ includeVideos?: boolean; /** * Include information about the albums each asset belongs to. Defaults to `false`. */ includeAlbumData?: boolean; /** * Include assets stored in the cloud (iCloud / Google Photos). Defaults to `true`. */ includeCloudData?: boolean; /** * If `true`, use the original filenames reported by the OS when available. */ useOriginalFileNames?: boolean; /** * Width of the generated thumbnails. Defaults to `512`. */ thumbnailWidth?: number; /** * Height of the generated thumbnails. Defaults to `384`. */ thumbnailHeight?: number; /** * JPEG quality for generated thumbnails (0-1). Defaults to `0.5`. */ thumbnailQuality?: number; /** * When `true`, copies the full sized asset into the app cache and returns its URL. * Defaults to `false`. */ includeFullResolutionData?: boolean;}GetLibraryResult
라이브러리 결과 가져오기export interface GetLibraryResult { assets: PhotoLibraryAsset[]; /** * Total number of assets matching the query in the library. `assets.length` can be less * than this value when pagination is used. */ totalCount: number; /** Whether more assets are available when using pagination. */ hasMore: boolean;}PhotoLibraryFile
사진 라이브러리 파일export interface PhotoLibraryFile { /** Absolute path on the native file system. */ path: string; /** * URL that can be used inside a web view. Usually produced by `Capacitor.convertFileSrc(path)`. */ webPath: string; mimeType: string; /** Size in bytes if known, otherwise `-1`. */ size: number;}PickMediaOptions
미디어 선택 옵션export interface PickMediaOptions { /** * Maximum number of items the user can select. Use `0` to allow unlimited selection. * Defaults to `1`. */ selectionLimit?: number; /** Allow the user to select images. Defaults to `true`. */ includeImages?: boolean; /** Allow the user to select videos. Defaults to `false`. */ includeVideos?: boolean; /** Width of the generated thumbnails for picked items. Defaults to `256`. */ thumbnailWidth?: number; /** Height of the generated thumbnails for picked items. Defaults to `256`. */ thumbnailHeight?: number; /** JPEG quality for generated thumbnails (0-1). Defaults to `0.7`. */ thumbnailQuality?: number;}PickMediaResult
미디어 선택 결과export interface PickMediaResult { assets: PhotoLibraryAsset[];}PhotoLibraryAsset
사진 라이브러리 자산export interface PhotoLibraryAsset { id: string; fileName: string; type: PhotoAssetType; width: number; height: number; duration?: number; creationDate?: string; modificationDate?: string; latitude?: number; longitude?: number; mimeType: string; /** Size in bytes reported by the OS for the underlying asset, if available. */ size?: number; albumIds?: string[]; thumbnail?: PhotoLibraryFile; file?: PhotoLibraryFile;}PhotoAssetType
PhotoAssetType 섹션export type PhotoAssetType = 'image' | 'video';진실의 근원
진실의 근원 섹션이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.
Getting Started에서 계속
Getting Started에서 계속 섹션Capgo를 사용 중이라면 Getting Started 대시보드와 API를 계획하고 운영하기 위해 연결하세요. Using @capgo/capacitor-photo-library 자연스러운 기능을 사용하는 데 @capgo/capacitor-사진 라이브러리를 사용하세요. API 개요 API 구현 세부 사항에 대해 소개 소개 구현 세부 사항에 대해 API 키 API 키 구현 세부 사항에 대해 기기 기기 구현 세부 사항에 대해