Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 1.3 KB

README.md

File metadata and controls

47 lines (28 loc) · 1.3 KB

Cordova CustomToast Plugin

Simple plugin that returns your string in Android native Toast message.

Greeting a user with "CustomToast" is something that could be done in JavaScript. This plugin provides a simple example demonstrating how Cordova plugins work.

Using

Clone the plugin

$ git clone https://github.com/praveen2gemini/cordova-plugin-mytoast.git

Create a new Cordova Project

$ cordova create CustomToast com.custom.CustomToast MyToast

Install the plugin

$ cd CustomToast
$ cordova plugin install ../cordova-plugin-mytoast

Edit www/js/index.js and add the following code inside onDeviceReady

    var success = function(message) {
        alert(message);
    }

    var failure = function() {
        alert("Error calling in MyToast Plugin");
    }

    mytoast.my_toast("This is my first toast message!", success, failure);

Install on Android platform

  cordova platform add android

Run the code

cordova run 

More Info

For more information on setting up Cordova see the documentation

For more info on plugins see the Plugin Development Guide