Getting Started
Copas prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
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.
Panduan
InstallAnda dapat menggunakan Setup yang Dibantu AI kami untuk menginstal plugin. Tambahkan Capgo kemampuan ke alat AI Anda menggunakan perintah berikut:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLalu gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pretty-toast` plugin in my project.Jika Anda lebih suka Setup Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah:
npm install @capgo/capacitor-pretty-toastnpx cap syncImpor
Judul Bagian “Impor”import { toast } from '@capgo/capacitor-pretty-toast';Tampilkan Toast
Bagian berjudul “Tampilkan Toast”toast.success('Saved', { message: 'Your changes are ready.',});Perbarui Toast yang Sedang Mengisi
Bagian berjudul “Perbarui Toast yang Sedang Mengisi”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);Ikuti Sebuah Promesi
Bagian berjudul “Ikuti Sebuah Promesi”await toast.promise(uploadFile(), { loading: { title: 'Uploading', message: 'Keep the app open while the file is sent.', }, success: 'Uploaded', error: 'Upload failed',});Ikon dan Gambar
Bagian berjudul “Ikon dan Gambar”Gunakan icon untuk nama simbol atau markup SVG mentah:
toast.info('New message', { icon: 'message.fill', message: 'Open the inbox to reply.',});Gunakan iconSource untuk gambar URI seperti. Ini mendukung https://, http://, file://, data:, blob:, jalur file absolut, atau { uri }.
toast.show({ title: 'Profile updated', message: 'Your avatar changed.', iconSource: 'https://example.com/avatar.png',});iconSource mengambil prioritas atas icon.
Teruskan dari Getting Started
Judul bagian “Teruskan dari Getting Started”Jika Anda menggunakan Getting Started untuk merencanakan pekerjaan plugin native, hubungkannya dengan Capgo Direktori Plugin untuk alur kerja produk di Direktori Plugin Capgo Capacitor Plugin oleh Capgo untuk detail implementasi di Capacitor Plugins oleh Capgo Menambahkan atau Mengupdate Plugin untuk detail implementasi di Menambahkan atau Mengupdate Plugins Alternatif Plugin Enterprise Ionic untuk alur kerja produk di Alternatif Plugin Enterprise Ionic, dan Capgo Build Nativ untuk alur kerja produk di Capgo Build Nativ