Giter Club home page Giter Club logo

Comments (8)

vfdev-5 avatar vfdev-5 commented on May 18, 2024 1

@joshgarwood, you are right, there is a problem with the documentation. As you suggest, the first method is the right one.

from awesome-cordova-plugins.

keithdmoore avatar keithdmoore commented on May 18, 2024

@4ware Are you talking about this plugin? https://github.com/transistorsoft/cordova-background-geolocation-lt

from awesome-cordova-plugins.

4ware avatar 4ware commented on May 18, 2024

@keithdmoore It might be wiser to use https://github.com/mauron85/cordova-plugin-background-geolocation since the original plugin moved to some paid "premium" scheme now.

from awesome-cordova-plugins.

vfdev-5 avatar vfdev-5 commented on May 18, 2024

I'd like to try write a wrapper in my fork
However, I do not understand how can I test it with an app...

from awesome-cordova-plugins.

ihadeed avatar ihadeed commented on May 18, 2024

hey @vfdev-5

I see you added the interfaces for now. Next step would be to add wrappers for the functions, then add the plugin to index.ts.

Once you're done with that run npm run build_bundle to compile the library and have something that you can import in a Cordova project and test.

from awesome-cordova-plugins.

vfdev-5 avatar vfdev-5 commented on May 18, 2024

Hi @ihadeed
I added wrappers for the functions and the plugin to the index.ts as you said. The compilation is OK and I 'tested' it with a demo application - ionic 2 version of this
What is the next step, pull-request, ... ?

from awesome-cordova-plugins.

ihadeed avatar ihadeed commented on May 18, 2024

@vfdev-5 yes if the functionality works submit a PR and I'll review & merge.

from awesome-cordova-plugins.

joshgarwood avatar joshgarwood commented on May 18, 2024

Is ionic-native now using this plugin instead of the one from mauron85? I recently got the latest ionic2 build (beta8), installed the mauron85 plugin, and imported ionic-native, but it looks like the configure function is now a promise instead of an observable:

    var backgroundOptions = {
            desiredAccuracy: 10,
            stationaryRadius: 10,
            distanceFilter: 30,
            debug: false
        };

        // This seems to work
        BackgroundGeolocation.configure(backgroundOptions).then((location) => {
            // do cool stuff here
            BackgroundGeolocation.finish();
        }).catch((err) => {
                console.log(err);
        });


        // this does not
        BackgroundGeolocation.configure(
            location => {
               // do cool stuff here
                BackgroundGeolocation.finish();
            }, 
            err => {
                console.log(err);
            }, 
            backgroundOptions);

The documentation suggests that the second implementation should work. So I'm just trying to figure out the proper way to do this. Any help would be much appreciated.

Thanks!

from awesome-cordova-plugins.

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.