prepareReportingCoords static method

int prepareReportingCoords(
  1. Coordinates coords, {
  2. int categId = 0,
})

Prepares a report for submission using explicit coordinates.

Validates and prepares a report at the specified geographic location without requiring active position tracking. Works only for Weather Hazard and its subcategories. Other categories require prepareReporting with high-accuracy position data for safety and accuracy reasons.

Operates in two modes based on categId:

  • Preparing mode (categId = 0): Returns a preparation ID for use with report. The ID expires after a short time (typically minutes).
  • Dry run mode (categId ≠ 0): Tests if the category can be reported at these coordinates without actually preparing. Returns error code as integer (check against GemError ID values).

Parameters

  • coords: Geographic coordinates where the event is being reported. Must be valid latitude/longitude values.
  • categId: Category ID for dry run validation, or 0 for actual preparation (default: 0). Use 0 when preparing for report submission.

Returns

Dry run mode (categId ≠ 0):

Preparing mode (categId = 0):

  • GemError.suspended.id if report rate limit exceeded.
  • Positive integer: Preparation ID for use with report (valid for short duration).

See also:

  • prepareReporting - Prepares report using current position (required for most categories).
  • report - Submits prepared report using returned preparation ID.

Implementation

static int prepareReportingCoords(
  final Coordinates coords, {
  final int categId = 0,
}) {
  final OperationResult result = staticMethod(
    'SocialOverlay',
    'prepareReportingCoords',
    args: <String, dynamic>{'coords': coords, 'categId': categId},
  );
  return result['result'];
}