dpa99c / cordova-plugin-request-location-accuracy

Cordova/Phonegap plugin for Android and iOS to request enabling/changing of Location Services by triggering a native dialog
96 stars 62 forks source link

Update Cordova plugin "Request location accuracy" to match current compatibility #73

Open SJDSNL opened 10 months ago

SJDSNL commented 10 months ago

I'm submitting a ... (check one with "x"):

Bug report

**Current behavior: Within RequestLocationAccuracy.m

The code:

- (BOOL)isLocationServicesEnabled
{
    BOOL locationServicesEnabledInstancePropertyAvailable = [self.locationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 3.x
    BOOL locationServicesEnabledClassPropertyAvailable = [CLLocationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 4.x

    if (locationServicesEnabledClassPropertyAvailable) { // iOS 4.x
        return [CLLocationManager locationServicesEnabled];
    } else if (locationServicesEnabledInstancePropertyAvailable) { // iOS 2.x, iOS 3.x
        return [(id)self.locationManager locationServicesEnabled];
    } else {
        return NO;
    }
}

Gives an Xcode error 'locationServicesEnabled' is deprecated: first deprecated in iOS 4.0. (Xcode 15.2)

I created a clean Cordova project and reinstalled the plugin, to no avail.

Expected behavior: It would be great if the plugin would be updated to match iOS's current compatibility requirements.

Steps to reproduce: When opening the plugin code in Xcode, it gives the error on compiling

Environment information

Runtime issue

iOS build issue:

Feature request

Update Cordova plugin "Request location accuracy" to match current compatibility It would be great if the plugin would be updated to match iOS's current compatibility requirements.

Documentation issue

Current version causes errors on modern iOS. In my case, when using an iFrame that uses user's location.