-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy attachments as temporary files before sending #6
base: master
Are you sure you want to change the base?
Conversation
Fix multiple attachments android
Revert "Fix multimple attachments android"
…ents-fix Fix multiple attachments android
Fixed a syntax error in RNMailModule.
Fixed various issue in android with multiple attachments.
This was necessary in my case as the files were local to the app. May not be necessary in other cases, in which case a boolean switch should be added.
@timscott your input on this PR would be useful. |
copy (file, temporaryFile); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
Log.e("RNMail", "Error copying to temporary file"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably fail here as temporaryFile will be null
I guess you are solving the problem that the mail program will not have permission to the original file if it's an app asset? I have solved that in my use case, by using However, I agree that it would be good to handle this case in a built-in way, and copying to a temp file seems fine. Some questions:
|
Thanks for those points. I had a look and found some documentation which looks like this issue could be avoided by using the FileProvider: https://developer.android.com/training/secure-file-sharing/share-file |
Cool, it would be great if you could get that working. It would allow me to delete some code from my app. My favorite coding is deleting code! |
This was necessary in my case as the files were local to the app. May not be necessary in other cases, in which case a boolean switch should be added.