MyPlugin

sectore0.1.017
platforms: ios
$ cordova plugin add de.websector.myplugin

Example of a native iOS plugin for using PhoneGap 3.0.

PhoneGap 3.0 introduces a new plugin architecture. With this release any custom plugin can be installed by using PhoneGap's CLI or Cordova Plugman.

For a better understanding of the changes of PhoneGap 3.0 this repository provides a very simple native iOS plugin.

Screen shot

screen shot

Installation

  • Make sure that you have Node and PhoneGap CLI installed on your machine.

  • Create your PhoneGap example app

phonegap create my-plugin-example-app && cd $_
  • Add the plugin to it
phonegap local plugin add https://github.com/sectore/phonegap3-native-ios-plugin
  • Open `index.html and add a button
<button onclick="myPlugin.sayHello();">Say hello to your plugin!</button>
  • Register plugin within config.xml of your app
<feature name="MyPlugin">
    <param name="ios-package" value="MyPlugin" />
</feature>
  • Build and run app
phonegap run ios

Author

Jens Krause // WEBSECTOR.DE

Bitdeli Badge