I've implemented follow this link.
Use SQLite In ionic 2
And as I known that SQLite native plugin is not support browser platform for now in Ionic 2 last version (rc6).
So, when I run ionic serve on the browser it will appear the message like below in console log.
Native: tried accessing the SQLite plugin but it's not installed.
Install the SQLite plugin: 'ionic plugin add cordova-sqlite-storage'
So I cannot test storage query with the browser, is there any way to test SQLite plugin (or use other storage query plugin like WebSQL) with ionic serve on browser.
Related
In this tutorial to use SQLite with PouchDB, the cordova plugin used is cordova-plugin-sqlite-2. Meanwhile in another tutorial to use SQLite in Ionic, the cordova plugin used is cordova-sqlite-storage.
What's actually the difference between the two plugins?
Is it possible to use cordova-sqlite-storage with PouchDB instead of cordova-plugin-sqlite-2 ?
And is it possible to use cordova-sqlite-plugin-2 when I want to work with Ionic 5 Native SQLite plugin (as the 2nd tutorial)?
UPDATE:
I tried creating an app that uses PouchDB and I installed cordova-sqlite-storage plugin instead of cordova-plugin-sqlite-2 because I want to use Ionic Native SQLite at the same time. When the app launches, I get an error as below:
ERROR Error: Uncaught (in promise): {"status":500,"name":"web_sql_went_bad","message":"unknown","reason":"Invalid database handle"}
at resolvePromise (zone-evergreen.js:797:1)
at resolvePromise (zone-evergreen.js:754:1)
at zone-evergreen.js:858:1
at ZoneDelegate.invokeTask (zone-evergreen.js:391:1)
at Object.onInvokeTask (core.js:34182:1)
at ZoneDelegate.invokeTask (zone-evergreen.js:390:1)
at Zone.runTask (zone-evergreen.js:168:1)
I have also installed pouchdb-adapter-cordova-sqlite in my project. According to pouchdb-adapter-cordova-sqlite, it should work with cordova-sqlite-storage as well as stated;
PouchDB adapter using native Cordova SQLite as its backing store. It
works with any one of the following Cordova plugins:
Cordova-sqlite-storage
cordova-plugin-sqlite-2
cordova-plugin-websql
Why did I get that error when I switched to using cordova-sqlite-storage?
Make sure to have only ONE of the plugins.
The error that I got seems to be caused by both plugins existing inside the package.json. I thought I've removed it by using the ionic cordova plugin rm cordova-plugin-sqlite-2 but when I removed and added the platform again, and run ionic cordova run android -l, the error still showed up and inside the package.json, apparently cordova-plugin-sqlite-2 was still available.
Checked inside the config.xml and removed it from there, removed and added the platform, error disappeared.
While using functionality of authentication through firebase, emulator is showing error i.e.{ you attempted to use a firebase module that is not installed on your android project by calling firebase.app() }.Please help me to resolve this error.
I'm using Expo as command line input.
react-native version -0.63.6,
"#react-native-firebase/app": "^8.4.3",
"#react-native-firebase/auth": "^9.2.3"
If you are using expo client, you should not use react-native-firebase modules because they are not compatible with expo client.
However, you can use firebase javascript SDK instead. It is all explained there.
Update 02-12-2021
Guys expo's eas-build is now public. You can add custom native codes and use react-native-firebase. Here is the link to a youtube tutorial. The video is short and super easy to follow. Here is the link to the docs
Previous answer
Currently, Firebase does not work in react native if you are using the mobile configuration. However, if you use the web configuration it will work. Here is the youtube tutorial. Watch from 38:20 to set up.
I followed this tutorial: https://devdactic.com/ionic-4-sqlite-queries/
I have a problem with the sqlitePorter plugin when I run this command on Visual Studio Code :
ionic serve --devapp
The application starts correctly on my mobile, but the following error suddenly appears in my console:
console.warn: Install the SQLitePorter plugin: ‘ionic cordova plugin add uk.co.workingedge.cordova.plugin.sqliteporter’
console.error: [plugin_not_installed error]
I do not really understand what happens because when I do “ionic cordova plugin ls”, the plugin is present.
Does anyone have an idea of what might be going on, and how can I fix that?
Thank you in advance
Ionic DevApp only supports a selective set of native plugins of which this plugin is not one of them.
If you wish to use this plugin, you need to do a full native build app using Ionic/Cordova.
For More Info: https://github.com/dpa99c/cordova-sqlite-porter/issues/42
I'm using steroids by appgyver (update to latest version which includes supersonic as well) to develop my app.
I'm confused about the SQLite plugin. First they supported and included it, then they remove it, then they say that it will not work unless you configure the custom build (and there is no much documentation about that)...
I have a very simple application: textarea and button. When you click the button you insert intto the database the value.
According to the docs https://github.com/brodysoft/Cordova-SQLitePlugin
I'm using var db = window.sqlitePlugin.openDatabase({name : "mydb"});
to open the database. I have the scanner app updated on both android and ios. The result is that in IOS works fine while in Android I get this error: "Cannot read property 'openDatabase' of undefined".
My question is: for IOS the app will stop working once deployed on the appstore?
Why it's working with IOS Scanner? Is it supposed to work? I understood they removed SQLIte support. I don't understand. Then, cause in IOS works, why in Android is not working?
Moreover, how to include SQLite plugin in a steroid project? Anyone was suffesfuul with that? I love appgyver, they did a wonderful job with steroids and supersonic, but... for this SQLite plugin and related support (even an example would do) I'm a bit concerned regarding my decision to go with steroids and not with xamarin for example.
Thank you guys.
AppGyver dev here! You need to include the SQLite plugin as a custom plugin to your app using our Build Service, and then build a stand-alone app: http://docs.appgyver.com/tooling/build-service/
The SQLite plugin is included in the iOS App Store Scanner for preview purposes, so that's the reason it's working on iOS and not on Android. This is actually something we're removing soon, so sorry for the confusion.
I'm using cordova 3.4.0 and the sqlite plugin (https://github.com/brodysoft/Cordova-SQLitePlugin) to develop an android app with a prepopulated database. I configured the plugin and the database following this post: http://www.corporatezen.com/2012/11/shipping-prepopulated-database-phonegap/
The problem is that the first time the app is launched, it copies the database from the assets folder to the database folder and on old devices with android 2.3.x it can take more than 10 seconds (I have a 90MB database). During this time the screen is black and users may think the app doesn't work and close it.
I tried to look for a faster way to copy the file, but I couldn't find anything.
I tried also to set a splashscreen, using the splascreen plugin (https://github.com/apache/cordova-plugin-splashscreen/blob/dev/doc/index.md) but it appears only after the black screen phase.
Do you have any suggestion?
Solved with this plugin: https://github.com/an-rahulpandey/cordova-plugin-dbcopy
With this, the java code to copy the db is called by the plugin and it's easier to show to the users a warning message created with HTML & Javascript.
I also agree with Sergio.
"dpcopy" is a simple, but a powerful tool.
https://github.com/an-rahulpandey/cordova-plugin-dbcopy
And I also recommend you to apply "Cordova-sqlite-evcore-extbuild-free."
Currently, I'm designing my apps with Cordova, IONIC in Visual Studio 2015 and I applied those two plugins above for prepopulated DB.
The following Git also will solve your question.
https://github.com/ymochi/prepopulated-DB-for-hybrid-applications