{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/120","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/120/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/120/events","html_url":"https://github.com/phonegap/phonegap-plugin-contentsync/issues/120","id":148326518,"number":120,"title":"iOS - Wrong download location?","user":{"login":"vernondegoede","id":2484832,"avatar_url":"https://avatars.githubusercontent.com/u/2484832?v=3","gravatar_id":"","url":"https://api.github.com/users/vernondegoede","html_url":"https://github.com/vernondegoede","followers_url":"https://api.github.com/users/vernondegoede/followers","following_url":"https://api.github.com/users/vernondegoede/following{/other_user}","gists_url":"https://api.github.com/users/vernondegoede/gists{/gist_id}","starred_url":"https://api.github.com/users/vernondegoede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vernondegoede/subscriptions","organizations_url":"https://api.github.com/users/vernondegoede/orgs","repos_url":"https://api.github.com/users/vernondegoede/repos","events_url":"https://api.github.com/users/vernondegoede/events{/privacy}","received_events_url":"https://api.github.com/users/vernondegoede/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-14T11:08:29Z","updated_at":"2016-04-19T10:29:11Z","closed_at":null,"body":"In the documentation it states that the plugin stores the synced content in the `cordova.file.dataDirectory` path from the cordova-plugin-file package. \r\n\r\nI'm using the following code the download my file:\r\n\r\n```\r\ndownloadFile: function (url, fileName) {\r\n        var sync = ContentSync.sync({\r\n            src: url,\r\n            id: 'image-' + fileName,\r\n            type: 'local'\r\n        });\r\n\r\n        sync.on('progress', function (data) {\r\n            console.log('progress', data.progress);\r\n        });\r\n\r\n        sync.on('complete', function (data) {\r\n\r\n            window.resolveLocalFileSystemURL(\"file://\" + data.localPath, function (entry) {\r\n                // entry is a DirectoryEntry object\r\n                console.log('entry in DirectoryEntry', entry);\r\n            }, function (error) {\r\n                console.log(\"Error: \" + error.code);\r\n            });\r\n\r\n            var imageTag = document.createElement('img'),\r\n                imageArea = document.getElementsByClassName('image-area');\r\n\r\n            imageTag.setAttribute('width', '100px');\r\n            imageTag.setAttribute('height', '100px');\r\n            imageTag.setAttribute(\"src\", data.localPath);\r\n\r\n            imageArea[0].appendChild(imageTag);\r\n        });\r\n\r\n        sync.on('error', function (e) {\r\n            console.log('error', e);\r\n        });\r\n\r\n        sync.on('cancel', function () {\r\n            // triggered if event is cancelled\r\n            console.log('Cancelled!');\r\n        });\r\n    }\r\n```\r\n\r\nThis should mean that the files should be downloaded to `Library/NoCloud/`. However, in Xcode it seems the files are downloaded to the `Library` folder. \r\n\r\nHere's a snippet from the Xcode console:\r\n\r\n```\r\n2016-04-14 12:14:18.845 Cravt B2B[82496:26895163] Moving /Users/vernon/Library/Developer/CoreSimulator/Devices/8F22FA0B-7899-4185-BF3D-9B9DF93F8221/data/Containers/Data/Application/A74492DC-FD7A-4D3F-B1B5-5B5A05EEDEA2/Library/320243.png to /Users/vernon/Library/Developer/CoreSimulator/Devices/8F22FA0B-7899-4185-BF3D-9B9DF93F8221/data/Containers/Data/Application/A74492DC-FD7A-4D3F-B1B5-5B5A05EEDEA2/Library/image-257\r\n```"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/comments/211847464","html_url":"https://github.com/phonegap/phonegap-plugin-contentsync/issues/120#issuecomment-211847464","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-contentsync/issues/120","id":211847464,"user":{"login":"vernondegoede","id":2484832,"avatar_url":"https://avatars.githubusercontent.com/u/2484832?v=3","gravatar_id":"","url":"https://api.github.com/users/vernondegoede","html_url":"https://github.com/vernondegoede","followers_url":"https://api.github.com/users/vernondegoede/followers","following_url":"https://api.github.com/users/vernondegoede/following{/other_user}","gists_url":"https://api.github.com/users/vernondegoede/gists{/gist_id}","starred_url":"https://api.github.com/users/vernondegoede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vernondegoede/subscriptions","organizations_url":"https://api.github.com/users/vernondegoede/orgs","repos_url":"https://api.github.com/users/vernondegoede/repos","events_url":"https://api.github.com/users/vernondegoede/events{/privacy}","received_events_url":"https://api.github.com/users/vernondegoede/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T10:29:11Z","updated_at":"2016-04-19T10:29:11Z","body":"It seems I was wrong. This actually seems to be the case everywhere. What am I doing wrong?\r\n\r\nIn the documentation it states that files should be downloaded to the `NoCloud` folder. However, my files are still stored in the `Library` folder.\r\n\r\nSnippet of my config.xml:\r\n\r\n```xml\r\n<?xml version='1.0' encoding='utf-8'?>\r\n<widget id=\"com.coqtail.cravtb2b\" version=\"0.0.1\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">\r\n...\r\n    <content src=\"index.html\" />\r\n    <preference name=\"iosPersistentFileLocation\" value=\"Library\" />\r\n    <preference name=\"BackupWebStorage\" value=\"none\" />\r\n    <preference name=\"Orientation\" value=\"landscape\" />\r\n    <plugin name=\"cordova-plugin-whitelist\" spec=\"1\" />\r\n    <preference name=\"exit-on-suspend\" value=\"false\" />\r\n...\r\n```"}}