Is it possible to run a part of my app in the background?
When incoming call arrives, it will call the application in background, and return those details with incoming number details (i.e name, state), which are already in a Web SQL database.
Currently I am showing an alert popup, with a message that includes the incoming number. Instead of this, I am looking for a customized popup which would look like Truecaller. Is this possible? And have the number details on that pop-up?
If App is not in background, It won't work.
I used
https://github.com/katzer/cordova-plugin-background-mode
and this is working when my whole application is going in background. But if there is a way to solve my problem using this plugin, please post here.
Cordova is kind of web-view, so unless and until your application is not open you application, you can not access Web-SQL data.You can do one the on first go, you can store all the data in SQLite .
There is cordova plugin available for SQLite:
https://www.npmjs.com/package/cordova-plugin-sqlite
There is no need to make background service to access the data.You directly access SQLite file from native code that you need to show in pop-up. You can to render to customize pop-up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With