https://github.com/don/cordova-plugin-hello
Sample Hello World Cordova Plugin
https://github.com/don/cordova-plugin-hello
Last synced: 9 months ago
JSON representation
Sample Hello World Cordova Plugin
- Host: GitHub
- URL: https://github.com/don/cordova-plugin-hello
- Owner: don
- License: other
- Created: 2012-07-20T22:21:39.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2022-06-06T15:30:51.000Z (about 4 years ago)
- Last Synced: 2025-03-29T07:05:02.685Z (about 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 18.6 KB
- Stars: 190
- Watchers: 12
- Forks: 208
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cordova Hello World Plugin
Simple plugin that returns your string prefixed with hello.
Greeting a user with "Hello, world" is something that could be done in JavaScript. This plugin provides a simple example demonstrating how Cordova plugins work.
## Using
Create a new Cordova Project
$ cordova create hello com.example.helloapp Hello
Install the plugin
$ cd hello
$ cordova plugin add https://github.com/don/cordova-plugin-hello.git
Edit `www/js/index.js` and add the following code inside `onDeviceReady`
```js
var success = function(message) {
alert(message);
}
var failure = function() {
alert("Error calling Hello Plugin");
}
hello.greet("World", success, failure);
```
Install iOS or Android platform
cordova platform add ios
cordova platform add android
Run the code
cordova run
## More Info
For more information on setting up Cordova see [the documentation](http://cordova.apache.org/docs/en/latest/guide/cli/index.html)
For more info on plugins see the [Plugin Development Guide](http://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)