Iniziare
Copia una promessa 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.
npm install @capgo/capacitor-pretty-toastnpx cap syncimport { 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 crudo:
toast.info('New message', { icon: 'message.fill', message: 'Open the inbox to reply.',});Usa iconSource per immagini URI simili. 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 Precedenza è data a icon.
Continua da Getting Started
Sezione intitolata “Continua da Getting Started”Se stai utilizzando Getting Started per pianificare il lavoro di plugin nativi, connettilo con Capgo Directory dei Plugin per il flusso di lavoro del prodotto in Capgo Directory dei Plugin, Capacitor Plugin da Capgo per i dettagli di implementazione in Capacitor Plugin da Capgo, Aggiunta o Aggiornamento dei Plugin per i dettagli di implementazione in Aggiunta o Aggiornamento dei Plugin, Alternative plugin Ionic Enterprise per il flusso di lavoro del prodotto in Alternative plugin Ionic Enterprise Capgo Costruzione nativa per il flusso di lavoro del prodotto in Capgo Costruzione nativa.