cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse MacFadyen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9279) the param size limit from js to ios native
Date Wed, 30 Sep 2015 00:41:04 GMT

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

Jesse MacFadyen commented on CB-9279:
-------------------------------------

I have tested this directly using a modified version of Device.
On my iPhone 6+ I was able to send a string of length 69,205,983 characters.

{code}
// Javascript 
var success = function(res){
    alert("success " + res);
}
var onerror = function(){
    alert("oops");
}
var strToPass = "";
for(var x = 0; x < 21; x++) {
    strToPass += strToPass + "asdasdasdasdasdasdasdasdasdasdasd";
}
// length is 69205983, and makes it round trip 
cordova.exec(success,onerror,"Device","testIt",[strToPass,strToPass.length]);


// Obj-C
- (void)testIt:(CDVInvokedUrlCommand*)command
{
    int stringLength = [((NSString*)[command argumentAtIndex:0]) length];
    int reportedLength = [[command argumentAtIndex:1] integerValue];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsInt:stringLength];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

{code}

> the param size limit from js to ios native
> ------------------------------------------
>
>                 Key: CB-9279
>                 URL: https://issues.apache.org/jira/browse/CB-9279
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 5.0.1
>         Environment: var PLATFORM_VERSION_BUILD_LABEL = '3.8.0';
>            Reporter: laoyao
>            Assignee: Jesse MacFadyen
>              Labels: cordova-ios-4.0.x
>
> such as following plugin:
> exec(success,error,myfunc,[param]);
> the param is a string and it's size may hundreds of KB, where native receive the param,
I found that the param is truncated.
> Is there any size limitation in plugins' param ? Please give me some advise,thank a lot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message