Flutter-geolocator: Open iOS location settings page

Created on 30 Nov 2018  路  11Comments  路  Source: Baseflow/flutter-geolocator

馃殌 Feature Requests


I would like to see a way to open iOS Location settings page.

Describe the feature

It would be nice to take the user to the Location Services settings page so that he/she can turn on location services from the app. Any kind of intent which we have in Android.

Platforms affected (mark all that apply)

iOS

enhancement

Most helpful comment

@dark-chocolate As @mleonhard stated, there is no allowed way for an app to open the iOS Settings app to the Location Setting page. I looked into this and came to the same conclusion. Unless you have found a way that it is possible to implement this feature, it will stay remaining closed.

All 11 comments

Not Just iOS it will be nice if we can open both iOS and Andriod Location Settings using just one package

@dark-chocolate @caztial,
Use PermissionHandler().openAppSettings() from the package permission_handler.

@cetorres That will open your app settings page, not the phone Location settings page.

I believe Apple provides no public API to open the Settings app on a particular page. They are now rejecting apps that use the private 'prefs:' API. See: https://github.com/mauron85/cordova-plugin-background-geolocation/issues/394

TLDR: This feature cannot be implemented.

@mleonhard I've seen couple of apps on the app store which does the same, they take you to the location page, where you can turn on the location services. I'm not sure what they did behind the scene.

yes just install Uber and see

@mleonhard I've seen couple of apps on the app store which does the same, they take you to the location page, where you can turn on the location services. I'm not sure what they did behind the scene.

Those must be old apps that have not been updated since Apple changed tightened their policy.

yes just install Uber and see

I just checked. I went to Settings / Privacy / Location Services, tapped the Location Services switch, and tapped the Turn Off button on the popup. Then I opened the Uber app, which showed a screen with a box "Enter pickup point" and a button "Turn on location services". Tapping the button opens the Uber app settings page with the Location option greyed out. Uber app 3.342.10000 on iOS 12.1.4.

I found no allowed way for an app to open the iOS Settings app to the Location Settings page.

TLDR again: This feature cannot be implemented.

@StijnWoerkom May I know why this issue was closed?

@dark-chocolate As @mleonhard stated, there is no allowed way for an app to open the iOS Settings app to the Location Setting page. I looked into this and came to the same conclusion. Unless you have found a way that it is possible to implement this feature, it will stay remaining closed.

I guess these guys have managed.
Check out this for reference: https://pub.dev/packages/app_settings
It would be great if we can get this feature with this good plugin. 馃憤

I guess these guys have managed.
Check out this for reference: https://pub.dev/packages/app_settings
It would be great if we can get this feature with this good plugin. 馃憤

Hi @techiesanket,

I mean no offense here but have you actually tried the plugin? Analyzing the iOS code it looks like it does exactly the same as we do at the moment. There are also issues confirming the behavior.

And indeed if I try it myself I am only able to open the Settings page on iOS:

import 'package:app_settings/app_settings.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Demo',
        home: Scaffold(
          floatingActionButton: FloatingActionButton(
            child: Icon(Icons.settings),
            onPressed: () => AppSettings.openLocationSettings(),
          ),
        ));
  }
}
Was this page helpful?
0 / 5 - 0 ratings