Reputation: 883
I want to allow people using my app to email themselves a backup copy of all the data stored in the app.
Is it possible to email the .sqlite to an email address from in the app? I have the email side of things working but am unsure how to go about using
[controller addAttachmentData:imageData mimeType:@"image/jpg" fileName:@"RobotWithPencil.jpg"];
to attach the .sqlite file.
Also, once I have done this, what is a good way of getting the .sqlite file back into the app?
Upvotes: 1
Views: 353
Reputation: 58097
See this tutorial on Ray Wenderlich's site for help exporting data.
As for as the MIME Type goes, this site suggests octet/application-stream
. (Kudos to Google on both counts.)
Of course, there is the MFMailComposer documentation if you need any clarification on that end.
Upvotes: 2