{"action":"opened","issue":{"url":"https://api.github.com/repos/EstebanFuentealba/react-native-share/issues/106","repository_url":"https://api.github.com/repos/EstebanFuentealba/react-native-share","labels_url":"https://api.github.com/repos/EstebanFuentealba/react-native-share/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/EstebanFuentealba/react-native-share/issues/106/comments","events_url":"https://api.github.com/repos/EstebanFuentealba/react-native-share/issues/106/events","html_url":"https://github.com/EstebanFuentealba/react-native-share/issues/106","id":206804052,"number":106,"title":"[iOS] Share.shareSingle shares the filepath instead of the file binary","user":{"login":"padupuy","id":715255,"avatar_url":"https://avatars.githubusercontent.com/u/715255?v=3","gravatar_id":"","url":"https://api.github.com/users/padupuy","html_url":"https://github.com/padupuy","followers_url":"https://api.github.com/users/padupuy/followers","following_url":"https://api.github.com/users/padupuy/following{/other_user}","gists_url":"https://api.github.com/users/padupuy/gists{/gist_id}","starred_url":"https://api.github.com/users/padupuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/padupuy/subscriptions","organizations_url":"https://api.github.com/users/padupuy/orgs","repos_url":"https://api.github.com/users/padupuy/repos","events_url":"https://api.github.com/users/padupuy/events{/privacy}","received_events_url":"https://api.github.com/users/padupuy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-10T14:06:06Z","updated_at":"2017-02-10T14:06:06Z","closed_at":null,"body":"Hello @EstebanFuentealba \r\n\r\nI use the latest version of your library 1.0.19 with RN 0.40.0.\r\nI try to share a local PDF file only by mail but \r\n\r\nThis code works really well on Android but unfortunately not on iOS, the filepath is shared instead of the file binary.\r\nIf I use Share.open instead of Share.shareSingle, the attachment looks good.\r\n\r\nIn the react-native-share code I can see the code is different to get the file from the url between `GenericShare.m` (https://github.com/EstebanFuentealba/react-native-share/blob/master/ios/GenericShare.m#L22) and `EmailShare.m` (https://github.com/EstebanFuentealba/react-native-share/blob/master/ios/EmailShare.m#L33)\r\n\r\nI would love to help but unfortunately I don't know objective-c :(\r\n\r\nHere is my code :\r\n\r\n```\r\nimport {Platform} from 'react-native';\r\nimport Share from 'react-native-share';\r\nconst RNFS = require('react-native-fs');\r\n\r\nconst PDF_MIME_TYPE = 'application/pdf';\r\n\r\nexport function sendPDFFileByMail(fileUrl) {\r\n    const fileName = fileUrl.substr(fileUrl.lastIndexOf('/') + 1);\r\n    const fileDest = `${Platform.OS === 'ios' ? RNFS.DocumentDirectoryPath : RNFS.ExternalDirectoryPath}/${fileName}`;\r\n\r\n    const downloadResult = RNFS.downloadFile({\r\n        fromUrl: fileUrl,\r\n        toFile: fileDest,\r\n    });\r\n\r\n    downloadResult.promise\r\n        .then(() => {\r\n            shareByMail(fileDest);\r\n        }).catch(e => console.log(error))\r\n}\r\n\r\nfunction shareByMail(url) {\r\n    url = `file://${url}`;\r\n\r\n    const shareOptions = {\r\n        title: 'Title',\r\n        message: 'Body',\r\n        url: url,\r\n        subject: 'Subject',\r\n        type: PDF_MIME_TYPE,\r\n        social: 'email'\r\n    };\r\n\r\n    Share.shareSingle(shareOptions).catch(e => console.log(e));\r\n}\r\n```\r\n\r\n![thumb_img_0054_1024](https://cloud.githubusercontent.com/assets/715255/22829150/5e04d242-efa1-11e6-9dc6-15bd4093a7c8.jpg)\r\n"}}
{"actor":{"display_login":"padupuy"}}