By wenzhi xue
- Install pocketchange library by following the instruction here https://pocketchange.com/documentation
- Move pocketchange.js to your project's www folder and include a reference to it in your html files.
- Create a folder called "com.pocketchange.phonegap" within your project's src/com/ folder and move the java file into it.
- Register plugin at res/xml/config.xml. plugin name = "PocketChangePlugin" value="com.pocketchange.phonegap.PocketChangePlugin
- Init pocketchange by adding "PocketChange.initialize(this, "you key");" to onStart() in "yourprojectname.java: under /src
- Done!
The plugin creates the object window.plugins.pocketchange
with five methods:
Displays the next pending notification. For example:
window.plugins.pocketchange.getNotification();
Open pocketchange store. For example:
window.plugins.pocketchange.openShop();