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.
-
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
Jens Krause // WEBSECTOR.DE