apache / apache/cordova-plugin-geolocation

iOS 16 CDVLocation.m throwing UI unresponsiveness warning in XCode - causing app to crash.

Open
#257 12 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
646
Forks
654
PR merge metrics
No merged PRs in 30d

Description

# Bug Report
A new feature in Xcode 14 is displaying purple warnings about UI Unresponsiveness coming from CDVLocation.m#L89 - this issue seems specific to iOS 16x too. Its a part of the `isLocationServicesEnabled` function.

`This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the `-locationManagerDidChangeAuthorization:` callback and checking `authorizationStatus` first.`

The warning gets thrown about 50 times too (not certain why though). I and others (on different forums) are experience app freeze/crashes with some getting apps rejected from app store.

## Problem
iOS 16 apparently has changed behavior regarding location permission checks - the specific code commented with `iOS 4.x` - so it looks like a fix for iOS 4 and has worked all the way through iOS 15 is now causing issues.

### What is expected to happen?
Work cleanly without throwing warnings.

### What does actually happen?
Throws the above warning.

### Environment, Platform, Device
Mac 13.2.1 Ventura
Xcode 14.2

### Version information
Cordova 11
cordova-ios: 6.2.0
iOS: 16.x

## 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

Inspect CDVLocation.m around line 89 and the isLocationServicesEnabled function; compare its iOS 4.x path with the iOS 16 warning and the suggested authorization callback behavior. Reproduce under Xcode 14.2 on iOS 16, then verify the warning no longer appears repeatedly and the app remains responsive without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.