Giter VIP home page Giter VIP logo

ble-background's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ble-background's Issues

Plugins aren't supported for [email protected]

For the build, I get the error code:

Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

I am running on MacOS Catalina v10.15.7. I can't add android platform nor build to ios platform.

Does not do anything in background on iOS (10.1)

I start the scan, and press home button to put it in background.
Nothing happends until I bring it to front, and then the notification appears.

So clearly, no JS code is ran when the app is in background.
It makes the whole thing useless :(

Background Syncing in iOS

Within this repo I have read all of the posts I could find about background syncing in iOS and reviewed the ble-background example, but that example only waits three seconds before starting the scan, so I am guessing the test app is only suspended, and not fully moved to a background state. Also, it's only running once instead of running repeatedly.

In my app I am using setInterval to check every minute if there is a device that is due to be synced and in range by running ble.scan. This process runs great while in the foreground, but when the app moves to the background the function specified in the setInterval command is no longer executed, which is why I think the ble-background example is not quite a full background syncing test.

I installed the plugin cordova-custom-config, added the settings for Background Scanning and Notifications on iOS, and verified those settings are being added to the Info.plist file. In the ble.scan command I am including a service that is specific to my device: ble.scan([config.bluetooth.custom.service], seconds, success, failure);.

I also installed the plugin cordova-plugin-background-fetch, which allows a javascript function to be executed every 15 minutes for 30 seconds. My function (which runs fine in the foreground) hangs when ble.scan is called and doesn't return anything. It seems that iOS is not allowing that command in this instance.

How are folks getting the scan to run at regular intervals in the background or otherwise connecting to peripheral devices in the background?

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.