{"id":13998,"date":"2016-03-29T15:30:32","date_gmt":"2016-03-29T19:30:32","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13998"},"modified":"2016-04-21T10:06:08","modified_gmt":"2016-04-21T14:06:08","slug":"universal-links-association-files-crashing-ios-apps","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/03\/29\/universal-links-association-files-crashing-ios-apps\/","title":{"rendered":"Universal Links Association Files Crashing iOS Apps"},"content":{"rendered":"<p><a href=\"http:\/\/www.macrumors.com\/2016\/03\/28\/ios-9-3-bug-safari-web-links-crashing\/\">Joe Rossignol<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.macrumors.com\/2016\/03\/28\/ios-9-3-bug-safari-web-links-crashing\/\">\n<p>A significant number of iPhone and iPad users on the <a href=\"http:\/\/forums.macrumors.com\/threads\/ios-9-3-links-in-safari-not-clickable-anymore.1962471\/\"><em>MacRumors<\/em> discussion forums<\/a>, <a href=\"https:\/\/discussions.apple.com\/thread\/7507396\">Apple Support Communities<\/a>, and <a href=\"https:\/\/twitter.com\/search?f=tweets&amp;vertical=default&amp;q=%40applesupport%20links&amp;src=typd\">Twitter<\/a> have reported an apparent iOS bug that causes Safari, Mail, Messages, Notes, Chrome, and select other preinstalled and third-party apps to crash or freeze after tapping or long-pressing on web links.<\/p>\n<\/blockquote>\n\n<p><a href=\"http:\/\/9to5mac.com\/2016\/03\/29\/apple-ios-9-crashing-bugs-when-tapping-links-fix-software-update\/\">Benjamin Mayo<\/a>:<\/p>\n<blockquote cite=\"http:\/\/9to5mac.com\/2016\/03\/29\/apple-ios-9-crashing-bugs-when-tapping-links-fix-software-update\/\"><p><a href=\"http:\/\/9to5mac.com\/2016\/03\/27\/some-users-reporting-iphone-crashes-on-ios-9-3-when-tapping-links-in-safari-and-other-apps\/\">Since posting our original story<\/a>, we have heard from a lot of readers that are affected by iOS 9 crashes or app hangs when tapping links, spanning multiple iOS versions (not just 9.3) and devices. In a statement, Apple has now confirmed that they are working on a fix for the problem, coming in a software update (presumably iOS 9.3.1).<\/p>\n<p>[&#8230;]<\/p>\n<p>Previously, we pinpointed Bookings.com as a cause of the bug, although noting it affects other apps as well. On Twitter, it was found that their website association file, used by the system for the universal links feature introduced with iOS 9, was many megabytes, grossly oversized. This would essentially overload the daemon that had to parse these files, causing the crashing. The Booking.com app has since corrected its payload file to be a far more reasonable 4 kilobytes. Users of Booking.com should delete and reinstall the app, to refresh the system caches for the URL association file.<\/p>\n<p>[&#8230;]<\/p>\n<p>Unfortunately, it is practically impossible to find out which apps are the misdemeanours. In terms of high-profile cases, we have heard that Wikipedia and Eat 24 are among the apps registering too many domains in their universal link directory.<\/p><\/blockquote>\n\n<p><a href=\"http:\/\/9to5mac.com\/2016\/03\/29\/apple-ios-9-crashing-bugs-when-tapping-links-fix-software-update\/\">Rosyna Keller<\/a>:<\/p>\n<blockquote cite=\"http:\/\/9to5mac.com\/2016\/03\/29\/apple-ios-9-crashing-bugs-when-tapping-links-fix-software-update\/\"><p>The bug has existed in every version of iOS 9, from the very beginning. Booking.com just happened to update their association file last week to a version that triggered the bug. It has nothing whatsoever to do with iOS 9.3.<\/p>\n<p>[&#8230;]<\/p>\n<p>There&rsquo;s no need to harbor any ill will towards booking.com for this. The documentation on Universal Links is extremely sparse. It never talks about the limits or best practices. It never even discusses how apple-app-site-association files are updated on iOS devices.<\/p>\n<p>The file itself is completely valid JSON and passes all correctness tests. It&rsquo;s just that iOS&rsquo; swcd daemon doesn&rsquo;t like it and chokes hard. It&rsquo;s nigh impossible for developers to test updates to their apple-app-site-association files from anywhere except the iOS simulator, which doesn&rsquo;t have all the resource limitations a real iOS device has when shared with multiple other iOS apps.<\/p>\n<p>[&#8230;]<\/p>\n<p>Eat24 and Wikipedia are <em>not<\/em> related to this issue. The wikipedia site association file registers 5 paths. The Eat24 site association file registers only 1 (and it&rsquo;s 156 bytes total). There&rsquo;s no need to mention apps that are totally unrelated to this issue. All it does is worry people.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/xeenon\/status\/714502764374560768\">Timothy Hatcher<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/xeenon\/status\/714502764374560768\"><p>New in iOS 9.3: Use <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/General\/Conceptual\/AppSearch\/UniversalLinks.html#\/\/apple_ref\/doc\/uid\/TP40016308-CH12-SW1\">wildcards<\/a> for the domain name associations of Universal Links to help reduce duplication.<\/p><\/blockquote>\n\n<p>Update (2016-03-30): <a href=\"http:\/\/daringfireball.net\/linked\/2016\/03\/29\/ios-9-link-bug\">John Gruber<\/a>:<\/p>\n<blockquote cite=\"http:\/\/daringfireball.net\/linked\/2016\/03\/29\/ios-9-link-bug\"><p>In the meantime, if you&rsquo;ve been hit by this bug, <a href=\"https:\/\/bencollier.net\/2016\/03\/how-to-fix-ios-9-3s-broken-safari-links\/\">Ben Collier has a step-by-step workaround guide<\/a>. (It&rsquo;s not simple.)<\/p><\/blockquote>\n<p>Gruber says that apps were misusing the Universal Links feature, but that&rsquo;s not clear to me.<\/p>\n\n<p>Update (2016-03-31): <a href=\"https:\/\/www.macstories.net\/news\/apple-releases-ios-9-3-1-with-fix-for-unresponsive-links\/\">Federico Viticci<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.macstories.net\/news\/apple-releases-ios-9-3-1-with-fix-for-unresponsive-links\/\"><p>Apple released iOS 9.3.1 earlier today, bringing a fix for a problem related to Universal Links that caused apps to become unresponsive after tapping web links.<\/p><\/blockquote>\n\n<p>Update (2016-04-21): <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/Security\/Reference\/SharedWebCredentialsRef\/index.html#\/\/apple_ref\/doc\/uid\/TP40014989\">Apple<\/a> (via <a href=\"https:\/\/twitter.com\/rosyna\/status\/723108348384546816\">Rosyna Keller<\/a>):<\/p>\n<blockquote cite=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/Security\/Reference\/SharedWebCredentialsRef\/index.html#\/\/apple_ref\/doc\/uid\/TP40014989\"><p>In iOS 9.3.1 and later, the file must be no larger than 128 KB (uncompressed), regardless of whether it is signed.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Joe Rossignol: A significant number of iPhone and iPad users on the MacRumors discussion forums, Apple Support Communities, and Twitter have reported an apparent iOS bug that causes Safari, Mail, Messages, Notes, Chrome, and select other preinstalled and third-party apps to crash or freeze after tapping or long-pressing on web links. Benjamin Mayo: Since posting [&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":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","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":[2],"tags":[131,31,1137,1310,96],"class_list":["post-13998","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-ios","tag-ios-9","tag-universal-links","tag-web"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13998","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=13998"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13998\/revisions"}],"predecessor-version":[{"id":14235,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13998\/revisions\/14235"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}