You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ally Ogilvie (JIRA)" <ji...@apache.org> on 2014/07/10 11:14:04 UTC

[jira] [Commented] (CB-6165) Removing the "OK" String from success callback

    [ https://issues.apache.org/jira/browse/CB-6165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14057291#comment-14057291 ] 

Ally Ogilvie commented on CB-6165:
----------------------------------

Sorry for the late reply: Here's a sample

cordova create ... 
<normal setup>

cordova platform add https://github.com/Wizcorp/phonegap-plugin-wizUtils
cordova build

Open project in Xcode
Check WizUtilsPlugin.m change from line 30 to:

- (void)getDeviceHeight:(CDVInvokedUrlCommand *)command {
    WizLog(@"[WizUtilsPlugin] ******* getDeviceHeight ");
    
    // CGRect screenRect = [[UIScreen mainScreen] bounds];
    // int _height = screenRect.size.height;
    
    CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
    [self writeJavascript: [pluginResult toSuccessCallbackString:command.callbackId]];
}

Run the application and tap the "Device Height" button. You will get an alert with string "OK".
:(


> Removing the "OK" String from success callback 
> -----------------------------------------------
>
>                 Key: CB-6165
>                 URL: https://issues.apache.org/jira/browse/CB-6165
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Ally Ogilvie
>            Assignee: Shazron Abdullah
>            Priority: Minor
>              Labels: core
>             Fix For: 3.6.0
>
>
> [Brief]
> If no "message" (e.g. messageWithString, messageWithInt) is given to the resultWithStatus success callback, an "OK" is added.
> [About]
> Since the very beginning oh PhoneGap a success callback without "message" (native args) has returned the string "OK" to the success function in JavaScript.
> There is no reason for this to be. The reason it's there is because it's been there from the beginning. But we should get rid of this now.



--
This message was sent by Atlassian JIRA
(v6.2#6252)