From 9c269fc9ba85dc407823c7a973240f8620db226e Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Thu, 21 May 2015 21:31:18 +0200 Subject: [PATCH] #35 Close toast when app is suspended or closed: documentation --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 436202f..f5194fb 100644 --- a/README.md +++ b/README.md @@ -118,16 +118,18 @@ Toast works with PhoneGap build too, but only with PhoneGap 3.0 and up. Just add the following xml to your `config.xml` to always use the latest version of this plugin: ```xml - + ``` -or to use this exact version: +or to use a specific version: ```xml - + ``` Toast.js is brought in automatically. There is no need to change or add anything in your html. ## 4. Usage + +### Showing a Toast You have two choices to make when showing a Toast: where to show it and for how long. * show(message, duration, position) * duration: 'short', 'long' @@ -148,6 +150,15 @@ You can copy-paste these lines of code for a quick test: ``` +### Hiding a Toast +In case you want to hide a Toast manually, call this: +```js +function hide() { + // this function takes an optional success callback, but you can do without just as well + window.plugins.toast.hide(); +} +``` + ### WP8 quircks The WP8 implementation needs a little more work, but it's perfectly useable when you keep this in mind: * You can't show two Toasts simultaneously.