Mit @capgo/capacitor-photo-library
Capacitor-Plugin Zeigt eine Fotogalerie als Web-Seite an oder eine langweilige native Anzeige, die Sie nicht ändern können, aber keine Autorisierung erfordern.
Installieren
bun add @capgo/capacitor-photo-library
bunx cap sync
Dieses Plugin enthüllt
checkAuthorization- Gibt den aktuellen Autorisierungsstatus ohne Benutzeranfrage zurück.requestAuthorization- Fordert Zugriff auf die Foto-Bibliothek an, wenn erforderlich.getAlbums- Holt die verfügbaren Alben ab.getLibrary- Holt Bibliotheksinhalte sowie URLs ab, die in der Web-Ansicht angezeigt werden können.
- Beispielhafte Verwendung
checkAuthorization
- Gibt den aktuellen Autorisierungsstatus ohne Benutzeranfrage zurück.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.checkAuthorization();
requestAuthorization
Anforderung des Zugriffs auf die Fotobibliothek, falls erforderlich.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.requestAuthorization();
getAlbums
Ruft die verfügbaren Alben ab.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getAlbums();
getLibrary
Ruft Bibliotheksassets zusammen mit URLs ab, die in der Webansicht angezeigt werden können.
import { PhotoLibrary } from '@capgo/capacitor-photo-library';
await PhotoLibrary.getLibrary();
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-photo-library/
- Dokumentation: /docs/plugins/photo-library/
Fortsetzen Sie mit der Verwendung von @capgo/capacitor-photo-library
Wenn Sie die Verwendung von Verwendung von @capgo/capacitor-photo-library um native Medien und Schnittstellenverhalten zu planen, verbinden Sie es mit @capgo/capacitor-photo-library für die Implementierungsdetails in @capgo/capacitor-photo-bibliothek, Einstieg für die Implementierungsdetails in Einstieg, Mit @capgo/capacitor-live-Aktivitäten für die native Fähigkeit in Mit @capgo/capacitor-live-Aktivitäten, @capgo/capacitor-live-Aktivitäten für die Implementierungsdetails in @capgo/capacitor-live-Aktivitäten und Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player.