[
https://issues.apache.org/jira/browse/CB-8137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14239222#comment-14239222
]
Ivan Karpan commented on CB-8137:
---------------------------------
Reproduced and looked into it. The problem was in "CDVFileTransfer.m", line
368, namely objc code expected third argument incoming from JavaScript to be
boolean. According to documentation:
https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md#download
The third parameter defines if all hosts should be trusted (from comments in
objc code - if self-signed certificates should be allowed), false by default.
The following code executes perfectly:
var options = new FileUploadOptions();
new window.parent.FileTransfer().download(uri,
'cdvfile://localhost/cache/'+destPath, fetchSuccess, fetchFailure, false,
options);
So this is not a bug, should be closed as such.
Although I must say that the documentation and objc is quit4e different
still... Options that come in from JavaScript are assigned to "objectId", which
does I am not sure what. It also expects "headers" to come in as the fifth
argument, which is inconsistent with documentation. In documentation it is said
that only headers override is supported but de facto it is not because of the
interface being inconsistent with documentation. I will open another issue for
this separate problem.
> Passing options to .download causes crash on iOS
> ------------------------------------------------
>
> Key: CB-8137
> URL: https://issues.apache.org/jira/browse/CB-8137
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File Transfer
> Environment: xcode 6
> iOS 8.1.1
> org.apache.cordova.file 1.3.1 "File"
> org.apache.cordova.file-transfer 0.4.7 "File Transfer"
> Cordova CLI 4.1.2
> Reporter: David Banham
>
> The minimal repro is:
> var options = new FileUploadOptions();
> new window.parent.FileTransfer().download(uri,
> 'cdvfile://localhost/cache/'+destPath, fetchSuccess, fetchFailure, options);
> The output from xcode is:
> 2014-12-09 11:45:29.274 iCSL[276:33032] -[__NSDictionaryM boolValue]:
> unrecognized selector sent to instance 0x17694c20
> 2014-12-09 11:45:29.275 iCSL[276:33032] *** Terminating app due to uncaught
> exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM
> boolValue]: unrecognized selector sent to instance 0x17694c20'
> *** First throw call stack:
> (0x24a9f49f 0x32693c8b 0x24aa48b9 0x24aa27d7 0x249d4058 0xaa493 0x88975
> 0x881ff 0x257a4f99 0x24a65c87 0x24a65803 0x24a63a53 0x249b13c1 0x249b11d3
> 0x2bd950a9 0x27fc0fa1 0x8e31b 0x32c13aaf)
> libc++abi.dylib: terminating with uncaught exception of type NSException
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]