Getting Started
Copia una richiesta 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.
Installare
Sezione intitolata “Installazione”Puoi utilizzare la nostra configurazione assistita dall'IA per installare il plugin. Aggiungi le Capgo competenze al tuo strumento di AI utilizzando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsUsa poi 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 l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma riportate di seguito:
npm install @capgo/capacitor-pretty-toastnpx cap syncImporta
Sezione intitolata “Importa”import { toast } from '@capgo/capacitor-pretty-toast';Mostra un Toast
Sezione intitolata “Mostra un Toast”toast.success('Saved', { message: 'Your changes are ready.',});Aggiorna un Toast di caricamento
Sezione intitolata “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);Segui una Promessa
Sezione intitolata “Segui una Promessa”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 intitolata “Icone e Immagini”Usa icon per un nome di simbolo o markup SVG raw:
toast.info('New message', { icon: 'message.fill', message: 'Open the inbox to reply.',});Usa iconSource per immagini URI-like. Supporta https://, http://, file://, data:, blob:, percorsi di file assoluti, o { uri }.
toast.show({ title: 'Profile updated', message: 'Your avatar changed.', iconSource: 'https://example.com/avatar.png',});iconSource ha la precedenza su icon.
Keep going from Getting Started
Sezione intitolata “Continua da Inizia”Se stai utilizzando Getting Started per pianificare il lavoro di plugin nativo, connettilo con Capgo Plugin Directory per il workflow del prodotto nella Capgo Directory dei Plugin Plugin di Capacitor da Capgo per i dettagli di implementazione in Plugin di Capacitor da Capgo, Aggiunta o Aggiornamento Plugin per i dettagli di implementazione in Aggiunta o Aggiornamento Plugin, Alternative Plugin Enterprise Ionic per il flusso di lavoro del prodotto in Alternative Plugin Enterprise Ionic, e Capgo Costruzione Nativa per il flusso di lavoro del prodotto in Capgo Costruzione Nativa.