cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ally Ogilvie (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-6165) Removing the "OK" String from success callback
Date Thu, 10 Jul 2014 09:48:05 GMT

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

Ally Ogilvie edited comment on CB-6165 at 7/10/14 9:47 AM:
-----------------------------------------------------------

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:

{code}
- (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]];
}
{code}
Run the application and open Safari debugger. Type:
{code}
wizUtils.getDeviceHeight(function(result) { alert(result)} )
{code}
You will get an alert with string "OK".
:(



was (Author: aogilvie):
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:

{code}
- (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]];
}
{code}
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)

Mime
View raw message