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

Polygon Geofence add via RPC call crashes the plugin #2183

Open
jwaldrip opened this issue Oct 21, 2024 · 4 comments
Open

Polygon Geofence add via RPC call crashes the plugin #2183

jwaldrip opened this issue Oct 21, 2024 · 4 comments

Comments

@jwaldrip
Copy link

Your Environment

  • Plugin version: 14.7.2
  • Platform: iOS
  • OS version: 18.1
  • Device manufacturer / model: iPhone 15
  • React Native version (react-native -v): 0.73.2
  • Plugin config
// Plugin state
{
  batchSync: false,
  didDeviceReboot: false,
  desiredAccuracy: 100,
  autoSync: true,
  stopDetectionDelay: 0,
  didLaunchInBackground: false,
  enableTimestampMeta: false,
  startOnBoot: true,
  disableStopDetection: false,
  activityType: 1,
  disableAutoSyncOnCellular: false,
  debug: true,
  autoSyncThreshold: 0,
  stopTimeout: 5,
  locationAuthorizationRequest: "Always",
  geofenceTemplate: undefined,
  stopOnStationary: false,
  isFirstBoot: false,
  disableElasticity: false,
  httpTimeout: 60000,
  stopOnTerminate: false,
  desiredOdometerAccuracy: 100,
  didRequestUpgradeLocationAuthorization: false,
  headers: {
    /* omitted */
  },
  maxRecordsToPersist: -1,
  activityRecognitionInterval: 10000,
  locationAuthorizationAlert: {
    titleWhenOff: "Location services are off",
    titleWhenNotEnabled: "Background location is not enabled",
    cancelButton: "Cancel",
    instructions:
      "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings.",
    settingsButton: "Settings"
  },
  isMoving: false,
  trackingMode: 1,
  stationaryRadius: 25,
  params: {},
  extras: {
    rationale: "tracking"
  },
  elasticityMultiplier: 1,
  disableLocationAuthorizationAlert: true,
  httpRootProperty: location,
  preventSuspend: false,
  disableMotionActivityUpdates: false,
  logMaxDays: 3,
  lastLocationAuthorizationStatus: 3,
  heartbeatInterval: 60,
  useSignificantChangesOnly: false,
  odometer: 1008231.9919245155,
  locationTimeout: 60,
  showsBackgroundLocationIndicator: false,
  minimumActivityRecognitionConfidence: 70,
  geofenceInitialTriggerEntry: true,
  schedulerEnabled: false,
  method: "POST",
  iOSHasWarnedLocationServicesOff: false,
  maxBatchSize: -1,
  url: "omitted",
  distanceFilter: 10,
  locationTemplate: 0,
  locationsOrderDirection: "ASC",
  persistMode: 2,
  stopAfterElapsedMinutes: -1,
  enabled: true,
  schedule: ["2018-11-27 18:00-20:00"],
  authorization: {},
  pausesLocationUpdatesAutomatically: true,
  geofenceProximityRadius: 2000,
  maxDaysToPersist: 1,
  logLevel: 5
};

Expected Behavior

When the device received the following RPC call. The device should add the polygon geofence and start reporting the geofence events.

{
  "ok": true,
  "background_geolocation": [
    [
      "setConfig",
      {
        "extras": { "rationale": "PREONSITE_TRACKING" },
        "schedule": ["2024-10-21-21:45 2024-10-22-05:00 location"],
        "desiredAccuracy": 10,
        "locationAuthorizationRequest": "Always"
      }
    ],
    [
      "addGeofence",
      {
        "vertices": [
          [39.67896291339058, -104.82659579000001],
          [39.678115073358825, -104.82925519493935],
          [39.67606824934767, -104.83035664508222],
          [39.67402148598885, -104.82925503733252],
          [39.67317370660943, -104.82659579000001],
          [39.67402148598885, -104.82393654266748],
          [39.67606824934767, -104.8228349349178],
          [39.678115073358825, -104.82393638506066]
        ],
        "identifier": "9334ee0b-4a08-4d68-9b17-a1dce7d4fbe8",
        "extras": { "rationale": "PREONSITE_TRACKING" },
        "notifyOnEntry": true,
        "notifyOnExit": true
      }
    ],
    ["start"]
  ]
}

Actual Behavior

The plugin crashes and stops reporting all events.

Steps to Reproduce

  1. Respond to location report with RPC call
  2. Observe logs
  3. Get crash dialog
  4. Nothing reported to logs regarding onhttp or ongeofenceschange hooks.

Context

Trying to add polygon geofence via RPC call.

Debug logs

Logs
Unable to get
@christocracy
Copy link
Member

Where’s your stacktrace?

@jwaldrip
Copy link
Author

Due to issues building locally, I cannot produce one. And for some reason the background tasks are also not sending them to firebase or sentry

@christocracy
Copy link
Member

Due to issues building locally

What issues?

You can view $ adb logcat for any device plugged into usb.

@jwaldrip
Copy link
Author

On iOS I cannot do that. This is crashing iOS and not android as far as I can tell.

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