Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onGeofencesChange not called #113

Closed
littlehome-eugene opened this issue Sep 2, 2019 · 4 comments
Closed

onGeofencesChange not called #113

littlehome-eugene opened this issue Sep 2, 2019 · 4 comments

Comments

@littlehome-eugene
Copy link

littlehome-eugene commented Sep 2, 2019

Your Environment

  • Plugin version: "react-native-background-geolocation": "^3.2.0",
  • Platform: Android
  • OS version: Mac high sierra
  • Device manufacturer / model: galaxy s10e
  • Flutter info (flutter doctor):
  • Plugin config:
     BackgroundGeolocation.ready({
       reset: false,
       stopTimeout: 1,
       debug: true,
       logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
       foregroundService: true,
       autoSync: true,
       url: TRACKER_HOST + this.state.username,
       stopOnTerminate: false,
       startOnBoot: true,
       notification: {
         title: 'react-native-background-geolocation',
         text: 'Tracking engaged'
       },
       heartbeatInterval: 60,
       enableHeadless: true,
       params: BackgroundGeolocation.transistorTrackerParams(DeviceInfo),
       maxDaysToPersist: 14
     }

Expected Behavior

did addGeofence and expected onGeofencesChange to get called (I'm modifying the demo app advanced/HomeView.tsx)

Actual Behavior

onGeofencesChange not called
onGeofence not called

Steps to Reproduce

I'm adding geofences like below (because addGeofences doesn't seem to succeed) .
And I see - addGeofence success in the console.

Still onGeofencesChange not getting called

   let geofences = response.data.results.map(review_meta => {

         let geofence = _.pick(review_meta, ['latitude', 'longitude', 'identifier'])
         let {latitude, longitude, identifier, ...extras} = review_meta

         let result = {
           ...geofence,
           radius: 250, /* meter */
           notifyOnEntry: true,
           notifyOnExit: true,
           extras,
         }
         return result
       })


       geofences.map(geofence => {
         BackgroundGeolocation.addGeofence(geofences, () => {
           console.log('- addGeofence success');
         }, (error) => {
           console.warn('- addGeofence error: ', error);
         })

       })

Context

I'm trying to add geofences and see if enter, exit works

Debug logs

Logs
PASTE_YOUR_LOGS_HERE
@christocracy
Copy link
Member

Perhaps there’s something important in the logs. Are you observing them?

@littlehome-eugene
Copy link
Author

littlehome-eugene commented Sep 2, 2019

  • addGeofence success
    [http] - {"responseText":"{"success":true}","status":200,"success":true}

not in the RN debugger, above are only logs I see after adding geofence.

I also found that demo sometimes doesn't show the circle for geofence right away after you add the geofence by long-clicking. (I think I did toggle off and on , and click other buttons to make the geofence circle appear)

@christocracy
Copy link
Member

I’m talking about naive android device logs, with adb logcat.

See the wiki Debugging.

@christocracy
Copy link
Member

Btw, do you know this is the Flutter version you’re posting at? There are 4 different ecosystems this plugin available:

  • Cordova
  • React Native
  • Flutter
  • Pure native.

Please post your issues at the appropriate repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants