IT story

iOS 시작 설정-> 제한 URL 체계

hot-time 2020. 9. 12. 11:33
반응형

iOS 시작 설정-> 제한 URL 체계


저는 최근 에이 멋진 웹 사이트 에서 자세히 설명 할 수있는 멋진 iOS5 사용자 정의 설정 URL 체계를 발견했습니다 .

이 기능이 작동하여 사용자를 내 응용 프로그램에서 설정 앱으로 안내합니다.

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

그러나 매개 변수 를 통해 제한 경로로 직접 라우팅 할 수 없습니다 path.

[[UIApplication sharedApplication] openURL:
   [NSURL URLWithString:@"prefs:root=General&path=Restrictions"]];

누구든지 이것에 대한 문서를 찾거나 이것을 작동시킬 수 있었습니까?

어떤 통찰력이라도 대단히 감사하겠습니다. 나는 사용자가 인앱 구매를 활성화하도록 시도하고 있으며 사용자가 수동으로 제한을 클릭하도록하지 않습니다 (명백하지 않음).


AS @Nix 왕 의 ANSWER THIS IS NOT IN WORK IOS 10


경고 :이 방법은 iOS 5.1 이상을 실행하는 장치에서는 작동하지 않습니다. 아래 Hlung의 설명을 참조하십시오.

그것은 가능성이 있습니다 path구성 요소가 실제 섹션이 아닌 다른 이름을 가지고 있지만, 그것은 당신이 현재 URL에서 바로 해당 섹션에 액세스 할 수 수도 있습니다. 가능한 URL 목록을 찾았고 제한 사항이 없습니다. 아직 찾지 못했을 수도 있습니다.

설정 앱에서 현재 알려진 URL 목록 :

  • prefs : root = General & path = 정보
  • prefs : root = General & path = ACCESSIBILITY
  • prefs : root = AIRPLANE_MODE
  • prefs : root = General & path = AUTOLOCK
  • prefs : root = General & path = USAGE / CELLULAR_USAGE
  • prefs : root = 밝기
  • prefs : root = General & path = Bluetooth
  • prefs : root = General & path = DATE_AND_TIME
  • prefs : root = FACETIME
  • prefs : root = 일반
  • prefs : root = General & path = 키보드
  • prefs : root = CASTLE
  • prefs : root = CASTLE & path = STORAGE_AND_BACKUP
  • prefs : root = General & path = INTERNATIONAL
  • prefs : root = LOCATION_SERVICES
  • prefs : root = ACCOUNT_SETTINGS
  • prefs : root = MUSIC
  • prefs : root = MUSIC & path = EQ
  • prefs : root = MUSIC & path = VolumeLimit
  • prefs : root = General & path = Network
  • prefs : root = NIKE_PLUS_IPOD
  • prefs : root = 참고
  • prefs : root = NOTIFICATIONS_ID
  • prefs : root = 전화
  • prefs : root = 사진
  • prefs : root = General & path = ManagedConfigurationList
  • prefs : root = General & path = 재설정
  • prefs : root = Sounds & path = Ringtone
  • prefs : root = Safari
  • prefs : root = General & path = Assistant
  • prefs : root = 사운드
  • prefs : root = General & path = SOFTWARE_UPDATE_LINK
  • prefs : root = STORE
  • prefs : root = TWITTER
  • prefs : root = General & path = USAGE
  • prefs : root = VIDEO
  • prefs : root = General & path = 네트워크 / VPN
  • prefs : root = 배경 화면
  • prefs : root = WIFI
  • prefs : root = INTERNET_TETHERING

iOS8부터는 다음을 사용하여 내장 설정 앱을 열 수 있습니다.

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
   [[UIApplication sharedApplication] openURL:url];
}

The actual URL string is @"app-settings:". I tried appending different sections to the string ("Bluetooth", "GENERAL", etc.) but seems only linking to the main Settings screen works. Post a reply if you find out otherwise.


If you add the prefs URL scheme to your iOS app, it will allow you to use all those schemes that we could in iOS 5. I've tested it on iOS 9, but I think it will work on older versions too.


Update:

prefs: will NOT work since iOS 10.


Yep, saw this (and many more), even implemented it in a test application. Really need to get the definitive word from Apple, but the community consensus opinion is Apple disallowed it in 5.1 after it was publicly "discovered/published", so applications containing it won't be accepted.

08/01/12 Update: Asked Apple through my developer account if there is a way to programmatically launch the WiFi Settings dialog. Here is the response:

"Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations."


In iOS 9 it works again!

To open Settings > General > Keyboard, I use:

prefs:root=General&path=Keyboard

Moreover, it is possible to go farther to Keyboards:

prefs:root=General&path=Keyboard/KEYBOARDS

I wanted to open the Bluetooth Menu in the Settings Application and the above path (prefs:root=General&path=Bluetooth) didn't work for me. What ended up working for me was

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=Bluetooth")!)

Make sure you have the prefs URL Scheme defined first.


Solution for iOS10. Works fine.

NSURL *URL = [NSURL URLWithString:@"App-prefs:root=TWITTER"];
[[UIApplication sharedApplication] openURL:URL options:@{} completionHandler:nil];

As of iOS10 you can use

UIApplication.sharedApplication().openURL(NSURL(string:"App-Prefs:root")!) 

to open general settings.

also you can add known urls(you can see them in the most upvoted answer) to it to open specific settings. For example the below one opens touchID and passcode.

UIApplication.sharedApplication().openURL(NSURL(string:"App-Prefs:root=TOUCHID_PASSCODE")!)

Here is something else I found:

  1. After I have the "prefs" URL Scheme defined, "prefs:root=Safari&path=ContentBlockers" is working on Simulator (iOS 9.1 English), but not working on Simulator (Simplified Chinese). It just jump to Safari, but not Content Blockers. If your app is international, be careful.
    Update: Don't know why, now I can't jump into ContentBlockers anymore, the same code, the same version, doesn't work now. :(

  2. On real devcies (mine is iPhone 6S & iPad mini 2), "Safari" should be "SAFARI", "Safari" not working on real device, "SAFARI" now working on simulator:

    #if arch(i386) || arch(x86_64)
        // Simulator
        let url = NSURL(string: "prefs:root=Safari")!
    #else
        // Device
        let url = NSURL(string: "prefs:root=SAFARI")!
    #endif
    
    if UIApplication.sharedApplication().canOpenURL(url) {
        UIApplication.sharedApplication().openURL(url)
    }
    
  3. So far, did not find any differences between iPhone and iPad.


Works Fine for App Notification settings on IOS 10 (tested)

if(&UIApplicationOpenSettingsURLString != nil){
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}

iOS 10

Use app-prefs:

App-prefs:root=MOBILE_DATA_SETTINGS_ID

See gist


I am updating one news here. Using 'prefs:' only is NOT rejected by Apple, I tested it and checked approved to the app store(in Aug, 2016). thx.

참고URL : https://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme

반응형