Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 10
Registered: ‎01-08-2014
My Device: z10
My Carrier: Vodafone

Geofencing problem

[ Edited ]

I'm developing an app that uses geofencing services.

 

I register a new location with:

 

void Service::monitor(QString name, double lat, double lon)
{


//new regior to monitor
geomonitor_region_t region = NULL;
geomonitor_create_region(&region, name.toUtf8().data());
geomonitor_region_set_circle_shape(region, lat, lon, RADIUS);
geomonitor_region_set_monitoring_mode(region, GEOMONITOR_MONITORING_MODE_PERSISTENT);
geomonitor_region_set_notification_invoke_target(region, TARGET_SERVICE.toUtf8().data(), GEOMONITOR_NOTIFICATION_DIRECT );
int errorCode = geomonitor_add(region);
if (errorCode!= 0)
     qWarning()<<"Error occurred with code " <<QString::number(errorCode)<<endl;
geomonitor_destroy_region(&region);
}

 

I manage triggers with:

 

void Service:: onInvoked(const bb::system::InvokeRequest& request)
{

if (request.action().compare("bb.action.GEOREGIONENTER") == 0)
       invokedGeoEntered(QString::fromLocal8Bit(request.data()));
else if (request.action().compare("bb.action.GEOREGIONEXITS") == 0)
       invokedGeoExits();

}

 

When I enter into a monitored location my app is invoked as I want (bb.action.GEOREGIONENTERED is called);

The problem is that "bb.action.GEOREGIONEXITS" event doens't run and I can't understand when a leave a monitored location.

 

Why?

 

Thanks, Mauro

Retired
Posts: 249
Registered: ‎07-14-2008
My Device: Not Specified

Re: Geofencing problem

Attaching a full geofence sample here.. This should help.

 

 

Highlighted
New Developer
Posts: 10
Registered: ‎01-08-2014
My Device: z10
My Carrier: Vodafone

Re: Geofencing problem

I followed this simple, too.
The enter events runs well.
The exit event doesn't run.

Why?
New Developer
Posts: 4
Registered: ‎03-21-2014
My Device: q10
My Carrier: three uk

Re: Geofencing problem

i have had massive problems with the exit trigger too - is this a known issue, because I have yet to find anyone who can help set it up correctly - it seems everyone has this problem?

New Developer
Posts: 1
Registered: ‎10-17-2014
My Device: Z10
My Carrier: TELCEL

Re: Geofencing problem

Im currently developing a geofence app, and i cant get the notification called for any of the region events, where are you testing this simulator or device? any help would be much apreciated