Closed alssl-ross closed 3 years ago
By removing lines 107-110 from CDVFileTransfer.m I was able to compile:
NSString* userAgent = [self.commandDelegate userAgent]; if (userAgent) { [req setValue:userAgent forHTTPHeaderField:@"User-Agent"]; }
it worked for me. Thanks.
This is again not working. Only the fork worked for me.
This is again not working. Only the fork worked for me.
+1
By removing lines 107-110 from CDVFileTransfer.m I was able to compile:
NSString* userAgent = [self.commandDelegate userAgent]; if (userAgent) { [req setValue:userAgent forHTTPHeaderField:@"User-Agent"]; }
you are life saver bro.
Excuse my ignorance, but if they work... why to install them the command is always the same? cordova plugin add cordova-plugin-file-transfer I have to do something else?
cordova plugin add https://github.com/sitewaerts/cordova-plugin-file-transfer
Thanks for the fork, seems to work nicely! :)
https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html
Anyone else notice that the download example in this blog post doesn't actually save the file? You can use cordova-plugin-file to do that like the example here: https://github.com/apache/cordova-plugin-file#write-to-a-file-
Given the plugin is deprecated, is it worth creating a pull request? I'm not sure if anyone is able to merge the pull request if it was created.
I've forked this repository and made this change in if it's of use to anyone:
Thank you very much
npm install https://github.com/apache/cordova-plugin-file-transfer.git
To anyone confused (like I was) by the above... it seems that running
cordova plugin add cordova-plugin-file-transfer
installs the latest tagged release from 2018
And running cordova plugin add https://github.com/apache/cordova-plugin-file-transfer
installs the master version which includes the fix
I guess tagging a new release would be pretty great
I tried to push that forward but failed, there are falling tests that prevent publishing a new version of this package to npm. If anyone is up for it, it would be great...
I tried jansc 's solution, but when I type ionic capacitor run ios -l --external, the file goes back to what it was. Changes are reverted. Any idea of why this happens?
NPM seems to have the current version (2.0.0) now. (From 09/2023.)
I don't know if there's any reason to keep using the sitewaerts version (which was a lifesaver!) or anything.
Bug Report
Problem
When building using cordova-ios v6.0.0 an error is thrown saying:
"No known instance method for selector 'userAgent' in CDVFileTransfer.m"
What is expected to happen?
iOS build and run without error.
What does actually happen?
Error occurs as above
Information
The error occurs on line 107 of CDVFileTransfer.m":
NSString* userAgent = [self.commandDelegate userAgent];
Command or Code
Create a Cordova v9 project using cordova-ios 6.0.0 platform and version 1.7.1 of cordova-plugin-file-transfer run: cordova build ios
Environment, Platform, Device
Build error occurs using Cordova v9. cordova-ios 6.0.0 cordova-file-transfer-plugin v1.7.1
Checklist