Code Monkey home page Code Monkey logo

Comments (2)

mrtree1 avatar mrtree1 commented on May 26, 2024

Right, so you are literally not using the plugin in that example. The 30 second timeout happens if a delegate is never set for listening to iBeacon events. It's really just a warning, and don't mean there's a real problem if you aren't using the delegate yet, so maybe it should just log as a warning.

The previous error text just looks related to an error being added to the console. I've not run your demo, but that is pretty much what your log is saying.

Try adding the bare minimum to suppress that error:

var delegate = new cordova.plugins.locationManager.Delegate();
cordova.plugins.locationManager.setDelegate(delegate);

to your code, and it should go away. I'll change it to a warning next time I make changes to the Android code anyway, as it's perfectly legitimate to not use a delegate on load.

I'm not entirely sure how the iBeacon plugin can effect anything else. All the callbacks are sent via a dedicated thread pool executor, so shouldn't block anything else even though the thread pool is pausable (and is paused initially until the delegate is added). That is the only thing which might be to blame though, so I'll take a look either today or tomorrow, when I get time. If you want to check it out yourself, just comment out all the function PausableThreadPoolExecutor.beforeExecution and the execution will never be paused for the executor. I'd be surprised if that made any difference, it implies all thread execution is being directed through my executor which is a bit bonkers.

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on May 26, 2024

Just looked at this and I've found the cause of the syntax error: missing quotes on the error message. If you locally change line 285 of LocationManager.java to this:

webView.sendJavascript("console.error('"+warning+"')");

the syntax error won't appear. I'm pushing the fix to my fork now, and I'll push it for Peter to look at when he gets time to merge.

Having looked at the rest of the Android code I don't see where it can conflict with another plugin as it's all using it's own thread pool. If you think that is wrong then do send in a sample with the second plugin showing the problem.

Cheers

Tree

from cordova-plugin-ibeacon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.