{"id":724,"date":"2015-08-27T16:14:40","date_gmt":"2015-08-27T16:14:40","guid":{"rendered":"http:\/\/phyline.com\/blog\/?p=724"},"modified":"2016-02-28T11:53:19","modified_gmt":"2016-02-28T11:53:19","slug":"como-abrir-las-preferencias-del-iphone-desde-nuestra-app-en-ios","status":"publish","type":"post","link":"http:\/\/sophyonline.com\/blog\/2015\/08\/como-abrir-las-preferencias-del-iphone-desde-nuestra-app-en-ios\/","title":{"rendered":"\u00bfC\u00f3mo abrir las preferencias del iPhone desde nuestra app?"},"content":{"rendered":"<p><span style=\"font-family: helvetica, arial, sans-serif;\"><a href=\"http:\/\/sophyonline.com\/blog\/wp-content\/uploads\/2015\/08\/swift-e1456593526993.png\" rel=\"attachment wp-att-685\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-685\" src=\"http:\/\/sophyonline.com\/blog\/wp-content\/uploads\/2015\/08\/swift-e1456593526993.png\" alt=\"swift\" width=\"900\" height=\"230\" \/><\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">En algunos momentos necesitaremos abrir las preferencias de iPhone para que el usuario pueda darle permisos, por ejemplo, a nuestras app para hacer algo. Un ejemplo ser\u00eda configurar un teclado custom, hecho por nosotros; a su\u00a0vez de hacerle un tutorial al usuario ense\u00f1\u00e1ndole en que secci\u00f3n de la configuraci\u00f3n de su iPhone debe aceptar los permisos, podr\u00edamos abrir desde nuestra aplicaci\u00f3n las preferencias de usuario.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/cloud.githubusercontent.com\/assets\/724536\/9033179\/41e2d7be-39c5-11e5-8c25-8d123923ae94.gif\" alt=\"\" width=\"373\" height=\"562\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">En el gif anterior, vemos un ejemplo de como abrir las preferencias de usuario en la secci\u00f3n de teclados.<\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><strong>Escribamos algo de c\u00f3digo:<\/strong><\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><!--more--><\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">1.- \u00a0Antes, debemos ir hasta la secci\u00f3n <strong>Info de nuestro Target<\/strong>, y seleccionar\u00a0<strong>Url Types.<\/strong>\u00a0Una vez ah\u00ed, debemos a\u00f1adir un nuevo tipo en el bot\u00f3n + (si es que no tenemos nada). En la secci\u00f3n: <strong>URL Schemes<\/strong> debemos escribir\u00a0<strong>prefs\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/cloud.githubusercontent.com\/assets\/724536\/9033051\/567a347a-39c4-11e5-9885-1e26460beab3.gif\" alt=\"\" width=\"769\" height=\"556\" \/><\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">2.- Seguido escribimos el c\u00f3digo necesario para abrir la opci\u00f3n que necesitemos:<\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><strong>Swift<\/strong><\/span><\/p>\n<pre lang=\"swift\"><span style=\"font-family: helvetica, arial, sans-serif;\"> UIApplication.sharedApplication().openURL(NSURL(string:\"prefs:root=General&amp;path=Keyboard\")!)<\/span><\/pre>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\"><strong>Objective-c<\/strong><\/span><\/p>\n<pre lang=\"objc\"><span style=\"font-family: helvetica, arial, sans-serif;\"> [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@\"prefs:root=General&amp;path=Keyboard\"]];<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;\">Es muy pero que muy sencillo, a continuaci\u00f3n colocar\u00e9 los diferentes URL schemes que podremos usar:<\/span><\/p>\n<blockquote><p><span style=\"font-family: helvetica, arial, sans-serif;\">prefs:root=General&amp;path=About<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=ACCESSIBILITY<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=AIRPLANE_MODE<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=AUTOLOCK<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=USAGE\/CELLULAR_USAGE<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Brightness<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Bluetooth<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=DATE_AND_TIME<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=FACETIME<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Keyboard<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=CASTLE<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=CASTLE&amp;path=STORAGE_AND_BACKUP<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=INTERNATIONAL<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=LOCATION_SERVICES<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=ACCOUNT_SETTINGS<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=MUSIC<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=MUSIC&amp;path=EQ<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=MUSIC&amp;path=VolumeLimit<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Network<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=NIKE_PLUS_IPOD<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=NOTES<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=NOTIFICATIONS_ID<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Phone<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Photos<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=ManagedConfigurationList<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Reset<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Sounds&amp;path=Ringtone<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Safari<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Assistant<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Sounds<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=SOFTWARE_UPDATE_LINK<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=STORE<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=TWITTER<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=USAGE<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=VIDEO<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=General&amp;path=Network\/VPN<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=Wallpaper<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=WIFI<\/span><br \/>\n<span style=\"font-family: helvetica, arial, sans-serif;\"> prefs:root=INTERNET_TETHERING<\/span><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; En algunos momentos necesitaremos abrir las preferencias de iPhone para que el usuario pueda darle permisos, por ejemplo, a nuestras app para hacer algo. Un ejemplo ser\u00eda configurar un teclado custom, hecho por nosotros; a su\u00a0vez de hacerle un tutorial al usuario ense\u00f1\u00e1ndole en que secci\u00f3n de la configuraci\u00f3n de su iPhone debe aceptar <a class=\"read-more\" href=\"http:\/\/sophyonline.com\/blog\/2015\/08\/como-abrir-las-preferencias-del-iphone-desde-nuestra-app-en-ios\/\">&hellip;&nbsp;<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-724","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/comments?post=724"}],"version-history":[{"count":9,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/724\/revisions"}],"predecessor-version":[{"id":837,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/posts\/724\/revisions\/837"}],"wp:attachment":[{"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/media?parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/categories?post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sophyonline.com\/blog\/wp-json\/wp\/v2\/tags?post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}