Geofence not triggering

后端 未结 4 1170
悲哀的现实
悲哀的现实 2020-12-10 17:43

I\'m trying to implement Geofence on my APP and the problem is that is not triggering when I\'m on the place that I\'ve marked.

The thing that I do is I

相关标签:
4条回答
  • 2020-12-10 18:30

    Make sure your service and broadcast receive have these property enabled in manifest.

      android:enabled="true"
      android:exported="true"
    
    0 讨论(0)
  • 2020-12-10 18:31

    If your Intent is already constructed with the proper class (see varunkr's answer), you also need to make sure the service is also included in your AndroidManifest.xml.

    <application
        ...
    
        <service android:name=".GeofencingTransitionIntentService" />
    
    0 讨论(0)
  • 2020-12-10 18:31

    As I already answer here, Geofence API is something like passive location receiver, i.e. you must requesting coordinates from LocationServices.FusedLocationApi.requestLocationUpdates in parallel when you need Geofence to work.

    0 讨论(0)
  • 2020-12-10 18:40

    It will never work because what you are doing is

    Intent intent = new Intent(appContext, GeofenceSingleton.class);
    

    passing intent to GeofenceSingleton ?

    What you need to do is

    Intent intent = new Intent(appContext, GeofenceTransitionsIntentService.class);
    
    0 讨论(0)
提交回复
热议问题