-
Notifications
You must be signed in to change notification settings - Fork 47
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
copyDbToStorage #38
Comments
Hi, |
I have tried both the destination with the app database name and without (as in the example). In the first case the plugin creates a folder on the storage with the db name. This is supposedly not correct? |
Thanks for debugging it. I also noticed the issue, I did a quick direct edit on Github, can you download the plugin from Github and test it? Make sure you use this code -
The / at the end of destination is very important. |
Just tested and there are some build errors. For me it seems the variable is declared but maybe it must be initialized first. Here's the log. I\m on Cordova 6.5.0 :
|
Quick fix is to use
for the initialization and it works then. Not sure if this is bullet proof. |
OK, here's a bullet proof version. Also sending a change to the repo + pr #39 :
|
Thanks for the pull request, I have merged with little changes. Please test it. While you are at it, can you please also test the copyDbFromStorage function? |
I'm doing this at the moment. Trying to first export the db and then import by closing the current, removing the current, copying from storage and opening again. I'll let you know. |
OK, the process works. I was able to backup my db to the path and then import it on another device. The |
Thanks for the support. Love to help whenever I can. |
My test device is Android 5.0 and I'm trying to utilize the copyDbToStorage() function to make a backup of my database, but each way I try the plugin reports error:
{"message":"/storage/sdcard1/Android/data/com.appbundleid: open failed: EISDIR (Is a directory)","code":400}
I call this function this way:
Could you please give a working example of this?
The text was updated successfully, but these errors were encountered: