{"action":"created","issue":{"url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/102","repository_url":"https://api.github.com/repos/johanneslumpe/react-native-fs","labels_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/102/comments","events_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/102/events","html_url":"https://github.com/johanneslumpe/react-native-fs/pull/102","id":157533582,"number":102,"title":"fix: workable path to external directory in android","user":{"login":"Frosty92","id":13985336,"avatar_url":"https://avatars.githubusercontent.com/u/13985336?v=3","gravatar_id":"","url":"https://api.github.com/users/Frosty92","html_url":"https://github.com/Frosty92","followers_url":"https://api.github.com/users/Frosty92/followers","following_url":"https://api.github.com/users/Frosty92/following{/other_user}","gists_url":"https://api.github.com/users/Frosty92/gists{/gist_id}","starred_url":"https://api.github.com/users/Frosty92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frosty92/subscriptions","organizations_url":"https://api.github.com/users/Frosty92/orgs","repos_url":"https://api.github.com/users/Frosty92/repos","events_url":"https://api.github.com/users/Frosty92/events{/privacy}","received_events_url":"https://api.github.com/users/Frosty92/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-30T16:53:52Z","updated_at":"2016-06-17T01:52:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/johanneslumpe/react-native-fs/pulls/102","html_url":"https://github.com/johanneslumpe/react-native-fs/pull/102","diff_url":"https://github.com/johanneslumpe/react-native-fs/pull/102.diff","patch_url":"https://github.com/johanneslumpe/react-native-fs/pull/102.patch"},"body":"I tried to get access to the files/directories inside the external storage in Android like this: \r\n\r\n```\r\nRNFS.readDir(RNFS.ExternalDirectoryPath)\r\n        .then((result) => {\r\n        console.log('GOT RESULT', result);\r\n            .catch(console.log)\r\n});\r\n```\r\nI got back an empty array, so I checked out how `ExternalDirectoryPath` was defined, which was: \r\n `File externalDirectory = this.getReactApplicationContext().getExternalFilesDir(null);` \r\n\r\nThe official documentation for [Android](https://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory()) has a different way of accessing the external directory, which is : `Environment.getExternalStorageDirectory()`. I tried this fix on Nexus 4, Moto E2, Nexus 6p and I am now able to get back an array of objects showing files and directories.\r\n\r\nThis pull request changes the definition of `ExternalDirectoryPath`."},"comment":{"url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/comments/226661448","html_url":"https://github.com/johanneslumpe/react-native-fs/pull/102#issuecomment-226661448","issue_url":"https://api.github.com/repos/johanneslumpe/react-native-fs/issues/102","id":226661448,"user":{"login":"superandrew213","id":13059204,"avatar_url":"https://avatars.githubusercontent.com/u/13059204?v=3","gravatar_id":"","url":"https://api.github.com/users/superandrew213","html_url":"https://github.com/superandrew213","followers_url":"https://api.github.com/users/superandrew213/followers","following_url":"https://api.github.com/users/superandrew213/following{/other_user}","gists_url":"https://api.github.com/users/superandrew213/gists{/gist_id}","starred_url":"https://api.github.com/users/superandrew213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superandrew213/subscriptions","organizations_url":"https://api.github.com/users/superandrew213/orgs","repos_url":"https://api.github.com/users/superandrew213/repos","events_url":"https://api.github.com/users/superandrew213/events{/privacy}","received_events_url":"https://api.github.com/users/superandrew213/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T01:52:08Z","updated_at":"2016-06-17T01:52:08Z","body":"Forked it for my use case. Here is the [PR](https://github.com/johanneslumpe/react-native-fs/pull/121) if you want to add this."}}
{"actor":{"display_login":"superandrew213"}}