shaqed
shaqed

Reputation: 392

Geofencing API: adding successful but not triggered

I'm working with the Google's Creating and Monitoring Geofences and I have done everything exactly like it (In fact I just downloaded and ran the example code from here)

I've configured everything like said the in tutorial.

After I perform this:

LocationServices.GeofencingApi.addGeofences(googleApiClient,
                    getGeofencingRequest(),
                    getGeofencingPendingIntent())
                    .setResultCallback(this);

My onResult():

@Override
public void onResult(@NonNull Status status) {
    if (status.isSuccess()) {
        L.log(this.getClass(), "Called... success");

    } else {
        L.log(this.getClass(), "Called... FAILURE: " + status.getStatusMessage() + " code: " + status.getStatusCode());

    }
}

Prints to Log that it has been successful.

Yet - When I inject coordinates to the emulator, the IntentService never seem to be triggered.

There is no exception thrown or anything, not even the constructor of the IntentService is called.

I wonder if this has something to do with the emulator or maybe the rules which I inject the coordinates are wrong ? Because I also downloaded Google's sample and couldn't get it to trigger either

Upvotes: 1

Views: 397

Answers (1)

Waqas Karim
Waqas Karim

Reputation: 21

If you are adding geofences properly and not generating the alert by Geofence. Make sure you added your Intent service in Manifest file. I hope this could solve your problem.

Upvotes: 2

Related Questions