cordova - File(Transfer) with PhoneGap Build is not working -
since not find answer anywhere else in related questions, i'm posting new question.
the problem is: when run ionic app via ionicview (useful app test application on device) works fine, when run ionic app after building phonegap build 2 specific plugins 'file' , 'filetransfer' don't work.
i use other plugins like: camera, network-information & geolocation , work fine after building phonegap build , running in ionicview. i'm thinking has config file, don't know is.
so have function:
function uploadpicture(fileurl) { var win = function(result) { alert('done!'); } var fail = function(err) { alert("fail!"); } var options = new fileuploadoptions(); options.filekey = "file"; options.filename = fileurl.substr(fileurl.lastindexof('/') + 1); options.mimetype = "image/jpeg"; options.chunkedmode = true; options.params = {}; var ft = new filetransfer(); ft.upload(fileurl, encodeuri("http://test.com/upload"), win, fail, options); }
the url not valid 1 example. code won't execute after line var options = new fileuploadoptions();
because says fileuploadoptions()
not defined. filetransfer
not defined. (after building phonegap build)
this config file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <widget id="xxx.ionicframework.xxxx" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0"> <name>xxx</name> <description> xxx </description> <author email="xx@xxx" href="http://example.com/"> xxx </author> <content src="index.html"/> <access origin="*"/> <preference name="phonegap-version" value="3.7.0" /> <preference name="webviewbounce" value="true"/> <preference name="uiwebviewbounce" value="true"/> <preference name="disallowoverscroll" value="true"/> <preference name="backupwebstorage" value="none"/> <preference name="orientation" value="landscape" /> <preference name="fullscreen" value="true" /> <feature name="statusbar"> <param name="ios-package" value="cdvstatusbar" onload="true"/> </feature> <feature name="networkstatus"> <param name="ios-package" value="cdvconnection" /> </feature> <feature name="file"> <param name="ios-package" value="cdvfile" /> <param name="android-package" value="org.apache.cordova.fileutils" /> </feature> <feature name="filetransfer"> <param name="ios-package" value="cdvfiletransfer" /> <param name="android-package" value="org.apache.cordova.filetransfer.filetransfer" /> </feature> <gap:plugin name="com.phonegap.plugin.statusbar" version="1.1.0" /> <gap:plugin name="org.apache.cordova.camera" version="0.3.2" /> <gap:plugin name="org.apache.cordova.device" version="0.2.12" /> <gap:plugin name="org.apache.cordova.file" version="1.3.1" /> <gap:plugin name="org.apache.cordova.file-transfer" version="0.4.6" /> <gap:plugin name="org.apache.cordova.geolocation" version="0.3.10" /> <gap:plugin name="org.apache.cordova.network-information" version="0.2.12" /> </widget>
anyone can me out suggestions?
just read little comment you've install application again (if have hydration enabled) when add new plugin.
now working fine. fixed!
Comments
Post a Comment