How to open Location services screen from setting screen?

前端 未结 11 2119
别那么骄傲
别那么骄傲 2020-12-04 14:01

I want to open location service screen programmatically to turn on service.

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 14:55

    First:

    Add URL

    Go to Project settings --> Info --> URL Types --> Add New URL Schemes

    See image below:

    Second:

    Use below code to open Location settings:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];
    

    referred from: https://stackoverflow.com/a/35987082/5575752

提交回复
热议问题