cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ally Ogilvie (JIRA)" <>
Subject [jira] [Commented] (CB-6165) Removing the "OK" String from success callback
Date Thu, 10 Jul 2014 09:14:04 GMT


Ally Ogilvie commented on CB-6165:

Sorry for the late reply: Here's a sample

cordova create ... 
<normal setup>

cordova platform add
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

> Removing the "OK" String from success callback 
> -----------------------------------------------
>                 Key: CB-6165
>                 URL:
>             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

View raw message