I need to implement some functionality that triggers an action on an interval and emits the results back to javascript.
To simplify things I will use the echo examp
You'll want to have something like:
NSString *myCallbackId;
as an instance-level variable (outside of any method, so it retains its value). Set it when you first come in to the plugin code:
myCallbackId = command.callbackId;
Then, right after you instantiate a PluginResult, but before using it, do something like:
[pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
That will tell it to keep the callback valid for future use.
Then do something like:
[self.commandDelegate sendPluginResult:pluginResult callbackId:myCallbackId];