How to jump to system setting's location service on iOS10?

后端 未结 6 1500
-上瘾入骨i
-上瘾入骨i 2021-01-05 09:59

Before I asked this question I had try:

  1. Use [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@\"prefs:root=Privacy&path=LOCATION\"]];<
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-05 10:19

    Thanks to this guy. I figure out this URL Scheme Prefs:root=Privacy&path=LOCATION is only available in Today Widget, but no use in containing app.

    In Today Widget, you can try this:

    [self.extensionContext openURL:[NSURL URLWithString:@"Prefs:root=Privacy&path=LOCATION"] completionHandler:nil];
    

    More about system URL Schemes, you can see here.

    This all I got. Hope it will help you.

提交回复
热议问题