I have been looking for a few days ago a plugin that allows me to execute a service in the background every x time and that I execute a fragment of code (for example a call ajax).
I have found the following plugin for cordova that allows you to create a background service with which you could get what I want, make an ajax call every 20 minutes and do something depending on what the json returns (for example return an local notification).
Do you think I could implement it in Ionic something similar using this plugin?
Iāve tried the example they have mounted on cordova and it seems to work
Iām also looking into using this for running some background operations. I donāt see why it wouldnāt work with Ionic, it is just a Cordova application underneath the hood. Please update this thread with how things work out for you.
I do ānpm i cordova-plugin-bgs-core --saveā and then i cannot do the import⦠Y tried import * from ācordova-plugin-bgs-coreā and ācom.red_folder.phonegap.plugin.backgroundserviceā. I tried doing: declare var cordova:any; and then cordova.pluginscom.red_folder.phonegap.plugin.backgroundservice.sample.enable(). Not worked for me. These are the installed plugins <plugin name="com.red_folder.phonegap.plugin.backgroundservice" spec="git+https://github.com/Red-Folder/bgs-core.git" />
Iām trying to do a background service when the app is closed to execute an http callback into a Json to check locally if i have changes in that json each hour
By the way iām trying to use the example who is in the docs.
Because this plugin itās only for IOs⦠I used that plugin but in ios mode, but in Android i canāt use that. I understand the other way you explained in the other post, but when i try to do this i get an error: import { myService } from ācom.red_folder.phonegap.plugin.backgroundservice.sampleā; i get an error