How to set timeout for getCurrentPositionAsync()?

Please provide the following:

  1. SDK Version: 44.0.0
  2. Platforms(Android/iOS/web/all): all
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hello, I am quite new to Expo and RN in general, and I am wondering if there is any way to set a timeout when requesting the current location:

const currentPosition = await Location.getCurrentPositionAsync({
      enableHighAccuracy: true,
    });

Or if there is a way to cancel the request after a while, because it seems to keep trying forever when it can’t get the location.
Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.