Opening the Settings app from another app

前端 未结 17 2231
傲寒
傲寒 2020-11-22 01:37

Okay, I know that there are many question about it, but they are all from many time ago.

So. I know that it is possible because the Map app does it.

In the M

17条回答
  •  星月不相逢
    2020-11-22 02:07

    Tested with iOS 10. Working

    NSArray* urlStrings = @[@"prefs:root=WIFI", @"App-Prefs:root=WIFI"];
    for(NSString* urlString in urlStrings){
    NSURL* url = [NSURL URLWithString:urlString];
    if([[UIApplication sharedApplication] canOpenURL:url]){
        [[UIApplication sharedApplication] openURL:url];
        break;
    }
    }
    

    Happy Coding :)

提交回复
热议问题