Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: iOS requests background location permission, although it shouldn't #2911

Open
derscott opened this issue Jun 15, 2023 · 0 comments
Open

Comments

@derscott
Copy link

derscott commented Jun 15, 2023

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

iOS

@rnmapbox/maps version

10.0.0-beta.64

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
  MapboxGL,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
          <MapboxGL.UserLocation
            requestsAlwaysUse={false}
            showsUserHeadingIndicator
            visible
          />
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

When rendering the MapboxGL.UserLocation component, on iOS there will always be a request for the background location permission, even with requestAlwaysUse explicitly set to false. The request is most likely triggered by this component, as it doesn't appear when commenting it out. I tested all scenarios after completely removing the app from iOS simulator to reset all permissions.

Expected behavior

When requestAlwaysUse is set to false (or not explicitly set), no request for background location permission appears.

Notes / preliminary analysis

No response

Additional links and references

UserLocation.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant