# cordova-plugin-rnk-toast

> android toast for cordova

Latest version **0.0.3** (published 2023-08-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-rnk-toast
pnpm add cordova-plugin-rnk-toast
yarn add cordova-plugin-rnk-toast
bun add cordova-plugin-rnk-toast
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-08-12 |
| First published | 2023-08-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rashid.nk |
| Maintainers | rashnk |
| Keywords | ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-rnk-toast
- Repository: https://github.com/rashnk/ToastPlugin
- Homepage: https://github.com/rashnk/ToastPlugin#readme
- Issues: https://github.com/rashnk/ToastPlugin/issues
- npm.io page: https://npm.io/package/cordova-plugin-rnk-toast

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-08-12
- 0.0.2 — 2023-08-12
- 0.0.1 — 2023-08-12

## README

# ToastPlugin
Android Toast for cordova
- [ToastPlugin](#toastplugin)
- [Install](#install)
- [Uninstall](#uninstall)
- [Usage](#usage)
- [Example](#example)
    - [Callback](#callback)
    - [Set Toast Duration](#set-toast-duration)
- [Plugin](#plugin)


# Install
`cordova plugin add cordova-plugin-rnk-toast`
# Uninstall
`cordova plugin rm cordova-plugin-rnk-toast`

# Usage
`cordova.plugins.rnk.toast.showToast(String msg, number duration, success, error)`

# Example
```JavaScript
// plugin will be availbale on deviceready event

var Toast;
document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
    console.log(cordova.plugins.rnk.toast);
    Toast = cordova.plugins.rnk.toast;
}

// show a simple toast
function showShortToast(){
    Toast.showToast("My short toast");
}

// show a long toast
function showLongToast(){
    Toast.showToast("My long toast", Toast.LONG) 
}



```

### Callback
```JavaScript

// callback after toast triggered
function showToastWithCallback(){
    Toast.showToast("My long toast", 0, success, error) 
}

function success(res){
    console.log(res)
}
function error(err){
    console.log(err)
}
```
### Set Toast Duration
```JavaScript
Toast.SHORT = 0 // number default
Toast.LONG = 1  // number
```

# Plugin

| Platform | Toast |   |   |   |
|----------|-------|---|---|---|
| android  | ✅     |   |   |   |
| ios      | ❌     |   |   |   |

---
_Source: https://npm.io/package/cordova-plugin-rnk-toast · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
