{"id":24449,"date":"2019-02-27T16:27:39","date_gmt":"2019-02-27T21:27:39","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=24449"},"modified":"2019-02-27T16:27:39","modified_gmt":"2019-02-27T21:27:39","slug":"uiapplicationopenurloptionuniversallinksonly","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/02\/27\/uiapplicationopenurloptionuniversallinksonly\/","title":{"rendered":"UIApplicationOpenURLOptionUniversalLinksOnly"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/jnadeau\/status\/1098805771880415233\">Jeff Nadeau<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/jnadeau\/status\/1098805771880415233\">\n<p>Hi, please preflight URLs with <code>UIApplicationOpenURLOptionUniversalLinksOnly<\/code> before jamming them in a <code>SFSafariViewController<\/code>, thanks in advance<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/rizzu26\/status\/1098813019348361216\">Rizwan<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/rizzu26\/status\/1098813019348361216\">\n<p>As per apple docs &ldquo;When you include this key in the options dictionary of the <code>openURL:options:completionHandler:<\/code> method, the method opens the URL only if the URL is a valid universal link and there is an installed app capable of opening that URL&rdquo;<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/recoursive.com\/2019\/02\/22\/preflight_universal_links\/\">Robin Kunde<\/a> shows how to do it in code.<\/p>\n\n<p>See also: <a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/core_app\/allowing_apps_and_websites_to_link_to_your_content\">Allowing Apps and Websites to Link to Your Content<\/a>.<\/p>\n\n<p>As a user, I find Universal Links confusing because I don&rsquo;t always know what&rsquo;s going to happen when I tap a link, and I can&rsquo;t seem <a href=\"https:\/\/stackoverflow.com\/questions\/32729489\/how-can-i-reset-ios-9-universal-linking-settings\">override<\/a> it to do <a href=\"https:\/\/twitter.com\/grynspan\/status\/1098965602880737280\">what I want<\/a> in a given situation.<\/p>","protected":false},"excerpt":{"rendered":"<p>Jeff Nadeau: Hi, please preflight URLs with UIApplicationOpenURLOptionUniversalLinksOnly before jamming them in a SFSafariViewController, thanks in advance Rizwan: As per apple docs &ldquo;When you include this key in the options dictionary of the openURL:options:completionHandler: method, the method opens the URL only if the URL is a valid universal link and there is an installed app [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-02-27T21:27:41Z","apple_news_api_id":"2e0e511a-e772-4f54-aa72-a3f21bc60a9d","apple_news_api_modified_at":"2019-02-27T21:27:42Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/ALg5RGudyT1SqcqPyG8YKnQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,31,1610,71,1310],"class_list":["post-24449","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-ios-12","tag-programming","tag-universal-links"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=24449"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24449\/revisions"}],"predecessor-version":[{"id":24450,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24449\/revisions\/24450"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=24449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=24449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=24449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}