You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ian Clelland (JIRA)" <ji...@apache.org> on 2014/04/02 19:51:18 UTC

[jira] [Resolved] (CB-6388) LOAD_URL Bridge fails to return binary data

     [ https://issues.apache.org/jira/browse/CB-6388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Clelland resolved CB-6388.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.5.0

Fixed in cordova-android (and cordova-js) for 3.5.0 release.

The decoding function is in base64.js, and so is called {{base64.toArrayBuffer}} for symmetry with existing functions.

A binary ArrayBuffer-destined message from native would look like

{code}
cordova.callbackFromNative('File1615636988',true,1,[require('cordova/base64').toArrayBuffer('4oKsw6sgLSBUaGVyZSBpcyBhbiBleGNlcHRpb24gdG8gZXZlcnkgcnVsZS4gIEV4Y2VwdCB0aGlzIG9uZS5iaW46AQA=')],false);
{code}


> LOAD_URL Bridge fails to return binary data
> -------------------------------------------
>
>                 Key: CB-6388
>                 URL: https://issues.apache.org/jira/browse/CB-6388
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.4.0
>            Reporter: Ian Clelland
>            Assignee: Ian Clelland
>             Fix For: 3.5.0
>
>
> In LOAD_URL nativeToJs mode, the Android native side of the bridge incorrectly encodes binary data.
> It serializes the data to Base64, but fails to quote it, or provide any hints to the receiving JavaScript about what to do with the data.
> A typical message (from mobile spec, file.spec.86), ends up encoded like this:
> {code}
> cordova.callbackFromNative('File1615636988',true,1,[4oKsw6sgLSBUaGVyZSBpcyBhbiBleGNlcHRpb24gdG8gZXZlcnkgcnVsZS4gIEV4Y2VwdCB0aGlzIG9uZS5iaW46AQA=],false);
> {code}
> which immediately results in a syntax error when passed to the webview.



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