Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

background-geolocation #101

Closed
4ware opened this issue Mar 31, 2016 · 8 comments
Closed

background-geolocation #101

4ware opened this issue Mar 31, 2016 · 8 comments

Comments

@4ware
Copy link

4ware commented Mar 31, 2016

I would love to migrate our app to ionic2 but this could not be done without this plugin.

@ihadeed ihadeed closed this as completed Apr 6, 2016
@ihadeed ihadeed reopened this Apr 6, 2016
@keithdmoore
Copy link
Contributor

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

@4ware
Copy link
Author

4ware commented Apr 18, 2016

@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.

@vfdev-5
Copy link
Contributor

vfdev-5 commented May 12, 2016

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

@ihadeed
Copy link
Collaborator

ihadeed commented May 13, 2016

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.

@vfdev-5
Copy link
Contributor

vfdev-5 commented May 17, 2016

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, ... ?

@ihadeed
Copy link
Collaborator

ihadeed commented May 17, 2016

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

@joshgarwood
Copy link

joshgarwood commented Jun 9, 2016

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!

@vfdev-5
Copy link
Contributor

vfdev-5 commented Jun 9, 2016

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

vfdev-5 added a commit to vfdev-5/ionic-native that referenced this issue Jun 9, 2016
@ihadeed ihadeed closed this as completed Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants