mrmans0n / smart-location-lib

Android library project that lets you manage the location updates to be as painless as possible
1.65k stars 353 forks source link

Geofincing doesn't work #215

Open GrishinSergey opened 7 years ago

GrishinSergey commented 7 years ago

Hello, guys. I know that about geofencing was many issues but i really don't know, what to do. They are not working. I write as in example:

        // point
        GeofenceModel gfm = new GeofenceModel.Builder("dwellGarage")
                .setTransition(Geofence.GEOFENCE_TRANSITION_ENTER)
                .setLatitude(49.4584119)
                .setLongitude(32.0338578)
                .setRadius(500)
                .build();

        // try to catch onGeofenceTransition but I do not get here
        mSmartLocation.geofencing().add(gfm).start(new OnGeofencingTransitionListener() {
           @Override
           public void onGeofenceTransition(TransitionGeofence transitionGeofence) {
               Log.wtf("GEOFENCE", "we are here");
           }
        });

Maybe this part of the library work in the old version and can I use it?

MrWeezle commented 6 years ago

I am having the same issue.

GeofenceModel homeFence = new GeofenceModel.Builder(SettingsActivity.FENCE_HOMELOCATION)
         .setTransition(Geofence.GEOFENCE_TRANSITION_ENTER | Geofence.GEOFENCE_TRANSITION_EXIT |Geofence.GEOFENCE_TRANSITION_DWELL)
         .setLatitude(48.341786)
         .setLongitude(10.905211)
         .setRadius(100)
         .build();              

SmartLocation.with(this).geofencing()
         .add(homeFence)
         .start(new OnGeofencingTransitionListener() {

             @Override
             public void onGeofenceTransition(TransitionGeofence transitionGeofence)
             {
                     MyLogger.d(TAG, "Geofence Transition:" + transitionGeofence.getTransitionType());
             }
          });

I'm not getting any Log output when moving around.

AbdullahAlAsad commented 6 years ago

Any Update ?

thats-bot commented 6 years ago

@mrmans0n I have the same issue. Any suggestions on this issue? It seems GeofencingService not triggered

araiyusuke commented 6 years ago

AndroidManifest.xml