Skip to content

rohdef/PGPlugins

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example: 2 - Simple callback

This shows how to do a basic callback in PhoneGap.

Interesting files:

pgplugins/Plugins/PluginExamples.m and pgplugins/Plugins/PluginExamples.h

Reads the first argument, which is a callback id that PhoneGap generates. This used to tell PhoneGap what function to call later on.

Use the doSuccess boolean to try the success and error callbacks.

The CDVPluginResult class from the cordova api is used to generate the callback, specifying the status and result data.

www/pluginExample.js

Not much to say. Creates too functions and send them to the cordova.exec call, so they can be used from the native code.

Navigation

Next: 3 Arguments

List of examples

Previous: 1 Basic plugin

About

PGPlugins example used for Phonegap Day Eu 2012

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published