{"action":"opened","issue":{"url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/161","repository_url":"https://api.github.com/repos/johanneslumpe/react-native-fs","labels_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/161/comments","events_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/161/events","html_url":"https://github.com/johanneslumpe/react-native-fs/issues/161","id":171969210,"number":161,"title":"Please could someone help me?  Returning object with a promise instead of promise...","user":{"login":"cyphire","id":337798,"avatar_url":"https://avatars.githubusercontent.com/u/337798?v=3","gravatar_id":"","url":"https://api.github.com/users/cyphire","html_url":"https://github.com/cyphire","followers_url":"https://api.github.com/users/cyphire/followers","following_url":"https://api.github.com/users/cyphire/following{/other_user}","gists_url":"https://api.github.com/users/cyphire/gists{/gist_id}","starred_url":"https://api.github.com/users/cyphire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyphire/subscriptions","organizations_url":"https://api.github.com/users/cyphire/orgs","repos_url":"https://api.github.com/users/cyphire/repos","events_url":"https://api.github.com/users/cyphire/events{/privacy}","received_events_url":"https://api.github.com/users/cyphire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-18T18:31:53Z","updated_at":"2016-08-18T18:31:53Z","closed_at":null,"body":"Could someone please help?  After using the latest code seeing that a promise isn't returned but an object I get function not found error.  If I unwrap the code and just have:\r\n\r\n`let obj =  RNFS.downloadFile(options);`\r\n\r\nI no longer get the error, but no combination of code I can figure out will let me use a .then to wait for the result.  I guess I can't see how an object returns and what to do with the promise!   I woiuld have used this in stack exchange but it's too specific to the module... Thanks so much.\r\n\r\nHere is the original code which worked great.\r\n\r\n```\r\n\t  var targetPath = in_parm.in_db_sys.downPath + in_parm.in_db_sys.realm_name + '.zip';\r\n\t  let fromU = in_parm.in_db_sys.server + 'Set1.zip';\r\n\r\n\t  var  options = {\r\n\t\t  fromUrl: fromU,\r\n\t\t  toFile: targetPath,\r\n\t\t  begin: mybegin,\r\n\t\t  progress: myprogress,\r\n\t\t  background: false,\r\n\t\t  progressDivider: 10\r\n\t\t};\r\n\r\n\t  RNFS.downloadFile(options)\r\n\t  .then((success) => {\r\nconsole.log('FILE Copied!' + JSON.stringify(success));\r\n\t  })\r\n\t  .then((res) => {\r\n\t\tZipArchive.unzip(targetPath, in_parm.in_db_sys.downPath)\r\n\t  })\r\n\t  .then((res) => {\r\n\t\t  console.log('unzip completed!');\r\n\t\t  getImportFiles(in_parm.in_db, in_parm.in_db_sys, in_parm.in_cur_bi, in_parm.in_maj_cat);\r\n\t\t})\r\n\t  .catch((error) => {\r\n\t\t  console.log(error)\r\n\t  })\r\n\r\n```"}}
{"actor":{"display_login":"cyphire"}}