Per iniziare
Copia un prompt di configurazione con i passaggi di installazione e la guida markdown completa per questo plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-pretty-toast`
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/pretty-toast/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.
Puoi usare il nostro setup assistito dall'IA per installare il plugin. Aggiungi le skill Capgo al tuo strumento di IA usando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsPoi usa il seguente prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pretty-toast` plugin in my project.Se preferisci la configurazione manuale, installa il plugin eseguendo questi comandi e segui le istruzioni specifiche per piattaforma qui sotto:
npm install @capgo/capacitor-pretty-toastnpx cap syncImporta
Sezione intitolata “Import”import { toast } from '@capgo/capacitor-pretty-toast';Avvio rapido
Sezione intitolata “Quick start”import { toast } from '@capgo/capacitor-pretty-toast';
toast.success('Saved', { message: 'Draft synced.' });Errori comuni
Sezione intitolata “Errori comuni”- Caricamento ID: mantieni gli ID quando chiami
toast.update(). - Debouncing: gli errori ravvicinati devono confluire in un unico toast.
- Branding: personalizza icone e colori per piattaforma.
Mostra un toast
Sezione: “Mostra un Toast”toast.success('Saved', { message: 'Your changes are ready.',});Aggiorna un toast di caricamento
Sezione: “Aggiorna un Toast di caricamento”const id = toast.loading('Uploading', { message: 'Waiting for the server response.',});
setTimeout(() => { toast.update(id, { title: 'Upload complete', message: 'The file was stored successfully.', icon: 'checkmark.circle.fill', autoDismiss: true, });}, 1500);Monitora una Promise
Sezione: “Monitora una Promise”await toast.promise(uploadFile(), { loading: { title: 'Uploading', message: 'Keep the app open while the file is sent.', }, success: 'Uploaded', error: 'Upload failed',});Icone e immagini
Sezione: “Icone e Immagini”Usa icon per un nome di simbolo o markup SVG grezzo:
toast.info('New message', { icon: 'message.fill', message: 'Open the inbox to reply.',});Usa iconSource per immagini di tipo URI. Supporta https://, http://, file://, data:, blob:, percorsi assoluti dei file, o { uri }.
toast.show({ title: 'Profile updated', message: 'Your avatar changed.', iconSource: 'https://example.com/avatar.png',});iconSource ha la precedenza su icon.
Continua da Getting Started
Sezione intitolata “Continua da Getting Started”Se stai usando Per iniziare per pianificare il lavoro sui plugin nativi, collegalo a Directory dei plugin di Capgo per il workflow del prodotto nella Capgo Plugin Directory, Plugin Capacitor di Capgo per i dettagli di implementazione in Capacitor Plugins di Capgo, Aggiunta o aggiornamento dei plugin per i dettagli sull'implementazione in Adding or Updating Plugins, Alternative ai plugin Ionic Enterprise per il workflow del prodotto in Ionic Enterprise Plugin Alternatives, e Capgo Native Build per il workflow di prodotto in Capgo Native Builds.