Charles Mulloy
Charles Mulloy

Reputation: 21

Can't open Settings URL string from iOS application

I had the following line of code working for a while, but it suddenly stopped working. It should open the Settings to the Keyboard section

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General&path=Keyboard/KE

I edited my Info.plist to add the "prefs" URL scheme. As shown in this image

Any advice on how to get this to work? I want to open to the Keyboards settings, but if I can only open to the main screen of the settings, that is fine too.

UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString)!);

I do not want this line of code because it deep links to my Apps settings, I do not want this.

Upvotes: 1

Views: 2160

Answers (2)

kai
kai

Reputation: 330

enter image description here

Please check whether your plist right. I use your code can open the Settings to the Keyboard

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General&path=Keyboard"))

Upvotes: 1

Parth Adroja
Parth Adroja

Reputation: 13514

You can open the main settings by

UIApplication.sharedApplication().openURL(NSURL(string:UIApplicationOpenSettingsURLString)!);

Upvotes: 1

Related Questions