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

Only "monitoring_region" #1

Open
oakleaf opened this issue Jul 2, 2018 · 2 comments
Open

Only "monitoring_region" #1

oakleaf opened this issue Jul 2, 2018 · 2 comments

Comments

@oakleaf
Copy link

oakleaf commented Jul 2, 2018

Hello, this is exactly what Im looking for! Awesome for that. But my issue is that it doesnt work for me at all. Well, Im successfully registering regions,

Started monitoring blaha region
{
identifier = blaha;
source = "[object CiGeofencingModule]";
type = "monitoring_region";
}

And the region Im testing has a radius for 10, which Im thinking means 10 meters for this module (?)

I have enabled "Location" as background data in the TiApp-file too.

Am I missing something here? The events are not firing while I work in and outside the region.

@gurudey
Copy link
Owner

gurudey commented Jul 3, 2018

Yes radius are in meters

ci_geofencing.startGeoFencing(regions, function(event) {
    if (event.type == "entered_region")
    {
	var notification = Ti.App.iOS.scheduleLocalNotification({
		alertAction: "Open",
		alertBody: "Hello",
		userInfo:{"hello":"world"},
	});
    }
});

Events works when you enter or exit a region. Make sure you have AUTHORIZATION_ALWAYS permissions.

Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
    if (!e.success) {
        Ti.API.info("-----------requestLocationPermissionsOFF----------");
    }
});

@oakleaf
Copy link
Author

oakleaf commented Jul 3, 2018

That is exactly how I structured everything. Been running some tests now, created 3 different regions now with different radius (50, 100 & 150m) and for a reason the one with 100m radius worked. Not awesome, but at least it showed me some data.

When looking at some other solutions in native, they've set the parameter to "identifier", which I think you use as "title". Might be a confusing thing.

One question though, would you mind share the module, maybe I can fork it and work further with it? Im missing some basic functionality such as resetting and extending regions.

Thanks!

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

2 participants