License sales launch: April 27, 2026 Get notified or view pricing

bglocation

Error Codes

All errors thrown by the plugin use string error codes. Catch them in your promise rejection handler and match on the code property.

Catching Errors

try {
  await start();
} catch (error: any) {
  switch (error.code) {
    case 'NOT_CONFIGURED':
      console.error('Call configure() first');
      break;
    case 'PERMISSION_DENIED':
      console.error('Location permission required');
      break;
    default:
      console.error('Unexpected error:', error.message);
  }
}

Error Code Reference

CodeDescriptionFix
NOT_CONFIGUREDAn API method was called before configure().Call configure() before start(), addGeofence(), getCurrentPosition(), etc.
GEOFENCE_LIMIT_EXCEEDEDAttempted to register more than 20 geofence regions.Remove unused geofences before adding new ones. Use a rotation strategy for dynamic regions.
GEOFENCE_ERRORNative geofence registration failed (invalid coordinates, system error).Verify latitude, longitude, and radius values. Ensure in-range coordinates and radius > 0.
UNSUPPORTEDThe operation is not supported on the current platform.Check the Platform Differences page to verify feature availability on your target platform.
TRIAL_COOLDOWNstart() called during the 1-hour trial cooldown period.Wait for the cooldown to expire, or configure a license key to unlock full mode.
PERMISSION_DENIEDRequired location permissions have not been granted.Call requestPermissions() first. On iOS, ensure Info.plist descriptions are set. On Android, ensure manifest permissions.

HTTP Event Errors

HTTP posting errors are delivered via the onHttp event, not thrown as exceptions. Check event.success and event.statusCode:

addListener('onHttp', (event) => {
  if (!event.success) {
    console.error(`HTTP ${event.statusCode}: ${event.error}`);
    console.log(`Buffered: ${event.bufferedCount}`);
  }
});

License Validation Errors

License errors do not throw — they are returned in the ConfigureResult object:

ErrorMeaning
Bundle ID mismatchThe license key was issued for a different app identifier.
Invalid signatureThe license payload is corrupted or tampered with.
Update expiredThe plugin version was released after the update window. Plugin still works, but you should renew or pin a compatible version.