Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Expo Location Error: Unhandled promise rejection: Error: Not authorized to use background location services

const onPress = async () => {
  const { status } = await Location.requestPermissionsAsync();
  if (status === "granted") {
    await Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, {
      accuracy: Location.Accuracy.BestForNavigation,
      timeInterval: 3000,
      foregroundService: {
        notificationTitle: "BackgroundLocation Is On",
        notificationBody: "We are tracking your location",
        notificationColor: "#ffce52",
      },
    });
  }
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Expo #Location #Unhandled #promise #Not #authorized #background #location #services
ADD COMMENT
Topic
Name
7+4 =