Created
August 17, 2011 16:35
-
-
Save mschulkind/1151959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start building the command object. | |
var command = { | |
className: service, | |
methodName: action, | |
arguments: [] | |
}; | |
// Register the callbacks and add the callbackId to the positional | |
// arguments if given. | |
var callbackId = null; | |
if (successCallback || failCallback) { | |
callbackId = service + PhoneGap.callbackId++; | |
PhoneGap.callbacks[callbackId] = | |
{success:successCallback, fail:failCallback}; | |
command.arguments.push(callbackId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register the callbacks if given. | |
var callbackId = null; | |
if (successCallback || failCallback) { | |
callbackId = service + PhoneGap.callbackId++; | |
PhoneGap.callbacks[callbackId] = | |
{success:successCallback, fail:failCallback}; | |
} | |
// Build the command object. | |
var command = { | |
className: service, | |
methodName: action, | |
arguments: [callbackId] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment