What is the best approach to back up customer data, no server support


I am now developing mobile app using nativescript, and now, I need to have capability to back up customer data, which is now saved in sqlLite db. Also I need to have solution to transfer data from one mobile device to another. the prerequisite is: there is NO server site support for this.

I plan to generate a file first for all the custom data, and then use email to send out this file as attachment. But now, my question is how can I read the email attachment from mobile app. I don’t see the solution to do that yet.

Or do you have other good suggestions to transfer data from one mobile device to another mobile device?



I found this article very relevant to your query




This is no specific to Nativescript. the thing is once you back up, how do
you transfer it to another device and then how do you open it, etc.
Hope to have more targeted solution.


To start, if you have the ability to send an email then you have internet connectivity and you SHOULD just use a server for this implementation. Anything outside of that is improper and just plain hacky.

Now continuing since that’s what you asked for:

  • You can email yourself a generated CSV on the device that mocks the data structure of your customer data
  • In iOS 11 they introduced the ability to store files locally as documents (accessible through a file manager). This means you can probably save to this location via opening that email as the end-user and then look for that location inside your app logic.
  • If your app recognizes the file exists, open it, process it however to seed your sqlite database and then either delete the file or set a flag indicating you already loaded that data.


This is ideal, but

I don’t see solution to save files into local iphone at all (not ios 11)

So I am looking for solution to be able to bind the file to my app directly
through file extension. Just like if you click attached file to email,
there will be a list of possible apps to be able to open this file. Then I
can select my app and read the file.

Is this function available to NativeScript?



Looks to be a configurable setting in xCode.


Hi, thanks for your solution. Now, I can add the app to the open list, but
then what will be next step?
How to read the file content in Nativescript? That Q&A stopped there and no
more introduction.
Any idea for how to read file content?