apache / apache/cordova-plugin-geolocation

On iOS with Allow once permission the permission is asked again without calling again the getCurrentPosition function

Open
#211 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
646
Forks
654
PR merge metrics
No merged PRs in 30d

Description

# Bug Report
On iOS when the user selects the Allow once permission on getCurrentPosition after a timeout the app is asking again for the location permissions.

## Problem

The permission is asked again from the user without user interaction.

### What is expected to happen?

The plugin should not ask for permission again.

### What does actually happen?

On iOS the didChangeAuthorizationStatus event is triggered after the requested permission is removed by apple.
This event restarts the whole flow.

## Information

### Command or Code

Just call the navigator.geolocation.getCurrentPosition and when asked for permission select allow once.
Put the app in the background and wait around 3-5 minutes. After the app is reopened there is a new permission request.

### Environment, Platform, Device

iPhone XS
iOS 13.6.1

### Version information

Cordova: 9.0.0, cordova-ios: 5.1.1
Other Framework: Ionic 5
Operating System: macOS 10.15.6, Xcode 11.7

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the flow from navigator.geolocation.getCurrentPosition: choose Allow Once, background the iOS app for 3–5 minutes, and reopen it. Trace the didChangeAuthorizationStatus event when the permission is removed and determine whether it restarts the request flow. Done means reopening after the timeout does not show another permission prompt without a new call.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.