storesafe / cordova-sqlite-storage

A Cordova/PhoneGap plugin to open and use sqlite databases on Android, iOS and Windows with HTML5/Web SQL API
Other
2.14k stars 713 forks source link

cordova-sqlite-storage plugin not works ios version 14 and above #973

Open rengarajan098015 opened 3 years ago

rengarajan098015 commented 3 years ago

Hi, we used the cordova-sqlite-storage with cordova app for offline data storage, Android app works well , but cordova-sqlite-storage not works ios version 14 and above, lesser than ios version 14 are works.

we updated latest version of cordova-sqlite-storage@6.0.0 since the problem is not solved, let me know what is the issue?

Error : Err status code :-7, Error Details: advanced-http: an error occured during post processing response: Web SQL is deprecated

brodybits commented 3 years ago

The error message indicates to me that you used window.openDatabase rather than sqlitePlugin.openDatabase.

This is a very unfortunate pitfall that I think needs to be documented more clearly.

rengarajan098015 commented 3 years ago

function GetFuelLogdata(Uid) { alert('GetFuelLogdata'); db = window.openDatabase("FLM", "12.0", "Fuel DB", 200000); alert('GetFuelLogdata_open db'); db.transaction(FuelLogDB, FuelLog_error, FuelLog_success); }

This is our code but i got only first alert, the secound alert not works in ios version 14 and above. It's goees above error. But same code works lower version ios 14 and Android phones

How to fix this issue

brodybits commented 3 years ago

The code you posted is using window.openDatabase, which opens a Web SQL database and has nothing to do with this plugin.

Please use sqlitePlugin.openDatabase or window.sqlitePlugin.openDatabase as I have documented for this plugin.

mirko77 commented 3 years ago

I confirm window.sqlitePlugin.openDatabase() works fine in iOS 14.

iskrid commented 2 years ago

There is no problem with iOS14, we use window.sqlitePlugin.openDatabase() on 50+ devices with different iOS14.x versions.