Backport iOS code to support URLs