Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 10 beta: URL scheme is not working but works in iOS 9

In one particular scenario I am taking the user to passcode settings page . below is the code used for this -

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

After upgrading to iOS 10 beta version I am no longer taken to settings passcode page instead it terminates the app .

Can anyone please help me with this . Thanks in advance .

like image 930
vijeesh Avatar asked Jun 22 '16 06:06

vijeesh


1 Answers

No way yet.

About 1 month before iOS 10 beta 1 was released, my app got a rejection because of opening a Preference.app URL. The app review team gave me a phone call to explain it: It's not permitted right now for the reason: Using private API. Only opening current app's setting page(UIApplicationOpenSettingsURLString) is allowed.

So it really makes sense now why they rejected me. Because no one could open system setting since iOS 10.

Updated answer at 8 Dec, 2016:

Using Private API (Don't submit the app with these code to the App Store):

@interface PrivateApi_LSApplicationWorkspace
- (BOOL)openSensitiveURL:(id)arg1 withOptions:(id)arg2;
@end

PrivateApi_LSApplicationWorkspace* _workspace;

_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];

BOOL result = (BOOL)[_workspace openSensitiveURL:[NSURL URLWithString:@"Prefs:root=YOURSETTINGURLHERE"] withOptions:nil];
like image 170
Croath Avatar answered Oct 05 '22 23:10

Croath