Skip to content

Instantly share code, notes, and snippets.

@edewit
Last active August 29, 2015 14:03
Show Gist options
  • Save edewit/125307d48e0e59f7c82d to your computer and use it in GitHub Desktop.
Save edewit/125307d48e0e59f7c82d to your computer and use it in GitHub Desktop.
- (void)echo:(CDVInvokedUrlCommand*)command
{
    CDVPluginResult* pluginResult = nil;
    NSString* echo = [command.arguments objectAtIndex:0];
    
    if (echo != nil && [echo length] > 0) {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
    } else {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
    }
    
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment