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
Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido
Accepted Solution

Headless Geofenching example not working. help!

I'm trying to add geofenching to my app and i'm following the example from there

 

https://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/trigger...

 

when calling function void ApplicationUI::registerWithGeofencingTrigger()

 

I'm getting error code 257.  I have allowed Location permission for the app and have changed the invoke target to my app.

 

anyone got this to work?

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

Re: Headless Geofenching example not working. help!

Is the error returned by a specific function call inside ApplicationUI::registerWithGeofencingTrigger() or are you just seeing it in the logs?

 

Either way, what you have shared below provides very little information to work with. 

Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Headless Geofenching example not working. help!


shaque wrote:

Is the error returned by a specific function call inside ApplicationUI::registerWithGeofencingTrigger() or are you just seeing it in the logs?

 

Either way, what you have shared below provides very little information to work with. 


when my app calls this function

 

                       geomonitor_region_set_notification_invoke_target(region, "com.example.test",  GEOMONITOR_NOTIFICATION_DIRECT );

                     //Adding the region
                        int errorCode =  geomonitor_add(region);

the errorCode = 516 which means

 

    /**
     * Offline notification invoke target is not valid or is used to invoke a
     * different application.
     */

my bar file invoke is

 

    <invoke-target id="com.example.test">
      <invoke-target-type>application</invoke-target-type>
    </invoke-target>

 

thanks

Highlighted
Developer
Posts: 43
Registered: ‎10-03-2008
My Device: Not Specified

Re: Headless Geofenching example not working. help!

Is it possible to provide the entire headless geofencing example as a downloadable project? I too am having issues with it, where I can see that the GPS is turning on and off but my headless service is never getting invoked.

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

Re: Headless Geofenching example not working. help!

It looks like you are trying to invoke an application target from the gefence trigger. Only headless entry points can be invoked from geofence trigger. You target essentially should look something like this:

    <invoke-target id="com.example.test">
      <invoke-target-type>application.headless</invoke-target-type>
    </invoke-target>

 

I am also attaching a sample on geofence trigger..