crosswalk-project / cordova-plugin-crosswalk-webview

Crosswalk WebView Cordova Plugin (UNMAINTAINED)
https://crosswalk-project.org/blog/crosswalk-final-release.html
Apache License 2.0
946 stars 350 forks source link

Ionic 4, Unable to create sqlite db in custom location #237

Open Rakshithkhatokar opened 5 years ago

Rakshithkhatokar commented 5 years ago

Hi

In my ionic app, i am logging the data inside every functions/implementation, Now the issue is , to store this log is i am using latest version of native sqlite plugin, it is working fine for default location, if i change the location path, by giving internal sd card i am gettin error as Valid IOS data base location could not be determined in open database call

code snippet my path, where db is to be created /sdcard/ReportLogs/ sqlite.create({name: dbName, location: "/sdcard/ReportLogs/"}).then((db: SQLiteObject) => { db.executeSql(query, []) .then(res => { resolve(res); console.log('Executed SQL') }) .catch(e =>{ reject(e); console.log(e)} );

  });
devShahNimesh commented 5 years ago

Following is my code snippet.

this.file.resolveNativePath('file://android/data/com.android.weightapp/file/db/').then(path=>{ this.sqlite .create({ name: "weightdb.db", location: path
}) .then((db: SQLiteObject) => { "CREATE TABLE IF NOT EXISTS test(rowid INTEGER PRIMARY KEY, m_id INTEGER,m_code TEXT, m_name TEXT, m_no TEXT)" }).then(res=>{ this.helper.toastMessage("First"+JSON.stringify(path)) alert("Sucess"+JSON.stringify(res)) }).catch(error=>{
alert("First Error"+ error) }) })

I am having the same error. Valid IOS data base location could not be determined in open database call.

Can anyone have the solution. Any help would be appreciated.