2016-09-09 15 views

Trả lời

0

Bạn có thể cần phải thêm một Scheme URL để dự án của bạn nếu bạn chưa có. Bạn có thể tìm thấy hướng dẫn và thông tin chi tiết tại số Apple Q&A Reference này. Hi vọng điêu nay co ich!

+0

Tôi đã thêm Sơ đồ URL, nhưng vẫn không hoạt động được – Rachit

+0

Bạn đã thử sử dụng '" prefs: root = General & path = Bàn phím "' thay vì '" prefs: root = General & path = Bàn phím/KEYBOARDS "'? –

+0

"prefs: root = General & path = Bàn phím" cũng không hoạt động – Rachit

4

Dường như chức năng này đã bị vô hiệu hóa trong iOS 10. Tôi tin rằng https://developer.apple.com/library/content/qa/qa1924/_index.html không còn giá trị. Tôi đã kiểm tra một số ứng dụng bàn phím hàng đầu và chúng đã được cập nhật để không còn có liên kết trực tiếp đến các tùy chọn hoặc có nút không hoạt động nữa.

0

Trong iOS 10, url mới là bắt buộc. Hãy thử sử dụng mã này mà kiểm tra cả các url:

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

là công việc trong iOS 10+

NSURL *keboardURL = [NSURL URLWithString: @"App-Prefs:root=General&path=Keyboard/KEYBOARDS"]; 
[[UIApplication sharedApplication] openURL:keyboardURL]; 

điểm chính:

@ "App-Prefs: root = chung & path = Keyboard/KEYBOARDS "

0
For IOS-10 or higher,openURL is deprecated. use with completion handler like below. 

NSString *settingsUrl= @"App-Prefs:root=General&path=Keyboard"; 
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0){ 
    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:settingsUrl]]) { 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:settingsUrl] options:@{} completionHandler:nil]; 
    } 
} 
Các vấn đề liên quan