toast — Toast
10/22/22Less than 1 minute
Short on-screen messages (Android Toast). Some OEMs restrict Toasts while the app is in the background or require notification permission.
Table of contents
Interfaces
Functions
Functions
showToast
showToast(msg: any, options?: "short" | "long" | ToastOptions): void
Shows a Toast. Duration defaults to "short"; "long" uses the platform’s long duration (exact timing varies by system).
Note: Toasts are queued. If you fire several in a row, they can still appear after your script has finished.
Example
"nodejs";
const { showToast } = require('toast');
showToast('Hello world!');Parameters
| Name | Type | Description |
|---|---|---|
msg | any | Message text (coerced to string as needed). |
options? | "short" | "long" | ToastOptions | Duration preset or detailed options. |
Returns
void
