Update Five 11:44 March 29/03/2016:

I’ve posted a shorter fix – here’s how to fix it with an iTunes sync and Airplane mode!

Update Four 11:10 March 29/03/2016: there’s a fix! There are a lot of steps, but if you really want to get back in action Wojtek Pietrusiewicz has a fix. Apparently he spent four hours getting it working.

Update Three 22:20 March 28/03/2016: a few updates have occurred to the Booking.com app, as these have appeared quicker than Apple would usually review them, my guess would be Apple is working with Booking.com to try and find a workaround without requiring a whole iOS release.

Update Two 15:00 March 28/03/2016: it looks like it might not be the size of the association file but an issue with Shared Web Credentials – which allows apps / websites to share login info.

Update One 13:00 March 28/03/2016: Booking.com have updated their association file – it’s now only 4KB – this hasn’t fixed the issue but should prevent new users that install from hitting the same problem. Even reinstalling the app and rebooting doesn’t fix it – the swcd (shared web credentials daemon) crashes once it’s got corrupt data in it.

Short version: there is currently no fix for this – we’re waiting on Apple to resolve. A reboot sometimes temporarily fixes the issue, and turning off JavaScript gets Google search results working again. If you haven’t got the problem – don’t install the Booking.com app (read on for more info).

A lot of users (including myself and a few friends) are experiencing links in Mail and Messages not working, and some links in Safari, like Google Search results, not opening. A long press on a broken link causes the app you’re in to crash, otherwise a standard tap highlights the link but nothing happens.

This issue was reported by some users on 9.2.1 but has only become widespread since 9.3 was released on 21st March 2016.

What’s Going On

In iOS 9 Apple introduced Universal Links, these allow app developers to associate their website and app, so links to the website can open the app up automatically if installed. For example, following a link to a Guardian article opens up the Guardian app to that specific article instead of their website.

App developers put an app association file on their website which lists which types of URLs the app can open. When you install an app, iOS downloads this associated file and updates your own database of what URLs your installed apps can open. The website and app listing in iTunes are linked by the developer – so it prevents anyone from hijacking your website with their app.

When you tap a link in iOS, the system looks through the database of installed apps supported URLs to see if it matches a pattern an installed app can handle. If nothing matches it opens it up as a standard app.

Why’s It Broken

It looks like there’s a bug in iOS that completely breaks the Universal Links if it gets served an app association file that’s too large.

Benjamin Mayo of 9to5mac.com reported installing the Booking.com app consistently broke their test devices – which led Steve Troughton-Smith (who else…) to take a peep at their association file:

Wow https://t.co/klS5VNaTfk literally put every URL they had into their site association file. 2.3MB download pic.twitter.com/sALK6nGkq2 — Steve T-S (@stroughtonsmith) March 28, 2016

It seems that the large size of their file, due to it having every URL from their website inside it breaks the iOS database on the device. Apple allows you to have pattern based matching, so instead of having to include every hotel’s URL in the association file, Booking.com could just put /hotel/* to match all the hotels on their site.

Whilst Booking.com aren’t following the recommended approach, it’s not their fault that a third-party can break a fundamental system feature like web browsing. Apple should be handling these edges graciously.

The worst part – deleting the app doesn’t clear the Universal Link association. Because the OS process that handles the Universal Links has crashed, it appears unable to remove the corrupt database.

The Workarounds

Unfortunately there’s no fix for this at the moment although a restart of the OS can temporarily restore links, and turning off JavaScript (Settings -> Safari -> Advanced) allows certain websites, such as Google search results to work again. Apple confirmed these workarounds to me, and hinted there may be a software update to resolve this;

Be sure to keep your software up to date in case a future release addresses this issue.

We do have two workaround options. Restarting the phone may allow links to work, but the issue can come back. The other workaround would be [to] turn off JavaScript.

Some users have been able to fix with an elaborate reboot cycle;

@stroughtonsmith @KhaosT To elaborate. Rebooted, downloaded app, enabled Airport, opened app, rebooted, deleted app, disabled airport mode — Rosyna Keller (@rosyna) March 28, 2016

The other unknown fix is whether Booking.com can resolve it for now by changing their association file (update – they have but it doesn’t help if you’re already hit by the problem). This would only be effective until the next app breaks it – the only long-term fix is an update from Apple.