@grabjs/superapp-sdk
    Preparing search index...

    Type Alias GetCoordinateResponse

    GetCoordinateResponse: BridgeResponse<
        200
        | 403
        | 424
        | 500
        | 501,
        GetCoordinateResult,
    >

    Response when getting the device coordinates.

    This response can have the following status codes:

    • 200: Coordinates retrieved successfully. The result contains latitude and longitude.
    • 403: Forbidden - client not authorized to access location data.
    • 424: GeoKit error - location services unavailable.
    • 500: Internal server error - an unexpected error occurred on the native side.
    • 501: Not implemented - this method requires the Grab app environment.

    Success response (200) - Singapore coordinates:

    {
    status_code: 200,
    result: { lat: 1.3521, lng: 103.8198 }
    }

    Forbidden response (403):

    {
    status_code: 403,
    error: 'Forbidden: Client not authorized to access location data'
    }

    Failed dependency response (424) - GeoKit error:

    {
    status_code: 424,
    error: 'GeoKit error'
    }

    Internal server error response (500):

    {
    status_code: 500,
    error: 'Internal server error'
    }

    Not implemented response (501) - outside Grab app:

    {
    status_code: 501,
    error: 'Not implemented: This method requires the Grab app environment'
    }