Cordova sqlite-storage does not work with iOS 10

0

I am developing an application for iOS and Android with Apache Cordova . I am using the plugin sqlite-storage to store data locally.

The code I use is the one shown on this site:

link

The App has been tested on both Android and the iOS simulator.

On Android it works fine, just like on iOS 9.3 .

The problem I have is when I try it on iOS 10 .

The JavaScript code is the same for both platforms and for the different versions of the Apple mobile operating system.

My question is: Does anyone know if I should use a different code for iOS 10 ?

I leave below a simple code that works well with iOS 9.3 , but DOES NOT work on iOS 10 .

var db = null;

document.addEventListener('deviceready', function() {
    db = window.sqlitePlugin.openDatabase({name: 'demo.db', location: 'default'});
    db.transaction(function(tx) {
    tx.executeSql('CREATE TABLE IF NOT EXISTS DemoTable (name, score)');
  }, function(error) {
    alert('Transaction ERROR: ' + error.message);
  }, function() {
    alert('Tabla creada!');
  });

What I get in iOS 9.3 is an alert that says: "Table created!", but when I try it in iOS 10 I do not get no result.

    
asked by haliovilla 08.11.2016 в 23:29
source

1 answer

0

apparently you are not the only one who fails this plugin with iOS 10 , there are many issues on errors that can occur, some give as a solution to execute cordova prepare before running the application in the simulator or in the device. Another solution is that you work with the version iOS cordova-ios-4.3.0 and this will not cause any problem!

GitHub issue Cordova SQLite Storage

Cordova prepare for XCODE 8 and higher

    
answered by 09.11.2016 в 12:44