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

Monitor multiple region #52

Open
05bca054 opened this issue Dec 24, 2014 · 2 comments
Open

Monitor multiple region #52

05bca054 opened this issue Dec 24, 2014 · 2 comments

Comments

@05bca054
Copy link

Hello Goldberg,

First of all Nice work. Hearty appreciate this plugin.

I'm pure phonegap developer nothing to done with native code.

1)Can we add multiple region to monitor with (Params)?
2)If we enters or exits from particular region it call twice for both(enter and exit) the region(Android).

Is it bug or something or i might have problem with my code.

Thanks & Regards,
-Naitik Joshi

@raldred
Copy link

raldred commented May 14, 2015

I'm getting similar behaviour, did you ever find a fix?
I've added two monitor regions.
The first region doesn't trigger, the second region triggers enter & exit callbacks three times.

I'm using a Nexus 5 running 5.1.1

@israelglass123
Copy link

Same problem here.

I've added two moniter regions.
The first only triggers when there is immediately GPS coverage, when not, only the second triggers.
The first triggers twice and the second three times...

I would really appreciate a fix.

code:

function onDeviceReady () {
alert("onDeviceReady");

                 window.plugins.DGGeofencing.initCallbackForRegionMonitoring(new Array(), processRegionMonitorCallback, function(error) {
                     alert("init error: "+error);
                     console.log("init error", error);
                 });


            User.getRetailerData().then(function (data) {
                angular.forEach(data.branches, function(branch) {
                    alert("The new ID added is: " + branch.id + "longitude is: " + branch.lon);

                    var params = [String(branch.id), String(branch.lat), String(branch.lon), "1500"];
                    window.plugins.DGGeofencing.startMonitoringRegion(params, function(result) { console.log('watching');}, function(error) {
                        console.log("failed to add region");
                    });
                });

            });

        }
        document.addEventListener("deviceready", onDeviceReady, false);

What could possibly be the problem??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants