Accueil
Copiez une commande de configuration avec les étapes d'installation et la guide markdown complet pour ce 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.
Sous-titre : "Installer"
Configurer avec l'IAVous pouvez utiliser notre configuration assistée par l'IA pour installer le plugin. Ajoutez les Capgo compétences à votre outil IA à l'aide de la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pretty-toast` plugin in my project.Si vous préférez la configuration manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques à la plateforme ci-dessous :
npm install @capgo/capacitor-pretty-toastnpx cap syncImporter
Section intitulée “Importer”import { toast } from '@capgo/capacitor-pretty-toast';Afficher un Toast
Section intitulée « Afficher un Toast »toast.success('Saved', { message: 'Your changes are ready.',});Mettre à jour un Toast de chargement
Section intitulée « Mettre à jour un Toast de chargement »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);Suivre une promesse
Section intitulée « Suivre une promesse »await toast.promise(uploadFile(), { loading: { title: 'Uploading', message: 'Keep the app open while the file is sent.', }, success: 'Uploaded', error: 'Upload failed',});Icônes et images
Section intitulée « Icônes et images »Utiliser icon pour un nom de symbole ou une mise en page SVG brute :
toast.info('New message', { icon: 'message.fill', message: 'Open the inbox to reply.',});Utiliser iconSource pour les images ressemblant à des URI. Il prend en charge https://, http://, file://, data:, blob:, les chemins de fichiers absolus, ou { uri }.
toast.show({ title: 'Profile updated', message: 'Your avatar changed.', iconSource: 'https://example.com/avatar.png',});iconSource a la priorité sur icon.
Continuez de l'Getting Started
Section intitulée “Continuez de l'Getting Started”Si vous utilisez Getting Started pour planifier le travail de plugin natif, connectez-le avec Capgo Répertoire de Plugin pour le flux de produit dans le répertoire de plugin Capgo Capacitor Plugins par Capgo pour le détail d'implémentation dans Capacitor Plugins par Capgo, Ajouter ou Mettre à Jour les Plugins pour le détail d'implémentation dans Ajouter ou Mettre à Jour les Plugins, Alternatives de Plugin d'Entreprise Ionic pour le flux de produit dans Alternatives de Plugin d'Entreprise Ionic, et Capgo Builds Natives pour le flux de produit dans Capgo Builds Natives.