Darc
Darc

Reputation: 883

How do I back up my App's data through email?

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

Answers (1)

Moshe
Moshe

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

Related Questions