Red-Folder / bgs-core

Core code for the Cordova Background Service
Other
236 stars 105 forks source link

javascript in service #67

Closed SidharthPHariharan closed 7 years ago

SidharthPHariharan commented 7 years ago

Hi RedFolder,

This is more of a suggestion, can you try including rhino in the service? This might help executing javascript code in android background service.

Hope this might be a good tip, I am trying to do something similar, lets see if I could achieve it.

Regards,

Red-Folder commented 7 years ago

What is Rhino? Is it JavaScript engine (similar to V8)?

If so, can you provide links to it. Yes it would be a great idea ... something I has a quick look at a few years back. I've done very little dev with the plugin for sometime - but this might be worth exploring

SidharthPHariharan commented 7 years ago

Well due to time contraint I ended up doing my stuff in java. For your reference here is a simple implementation of rhino http://stackoverflow.com/questions/3995897/rhino-how-to-call-js-function-from-java I suppose this link has 1.6 version of the build http://java2s.com/Code/Jar/r/Downloadrhino16R7jar.htm latest is 1.7.x but for now this will do.

Red-Folder commented 7 years ago

It's an interesting idea .... though I'm not sure that Rhino is the way to go.

Looking at the docs page (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Overview) it supports "all the features of JavaScript 1.7" (I think that was released about 10 years ago).

Given it's age I suspect if I implemented into the BGS that, due to the version differences, there would be a lot of inconsistency between the BGS & Cordova webview.

I'd suspect there is an answer - I've just never had the time (or drive) to investigate it

SidharthPHariharan commented 7 years ago

lets see if we could get some other engine to run. I thought for basic ajax call and other stuffs we could use rhino.. Wouldn't that be the case why most ppl go for background service?

srsarcasmo commented 7 years ago

como implementar el senso de ubicaciones de usuario ?

Red-Folder commented 7 years ago

No plans to implement this. I largely see this plugin being depreciated due to the availability of Service Workers/ Progressive Web Apps, etc.