[ios] Fixed crash on urls with spaces

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2021-06-18 13:19:39 +02:00 committed by Viktor Govako
parent e8ebb296f2
commit 9715da47c8

View file

@ -28,7 +28,9 @@
func applicationDidReceiveUniversalLink(_ universalLink: URL) -> Bool {
// Convert http(s)://omaps.app/ENCODEDCOORDS/NAME to om://ENCODEDCOORDS/NAME
self.url = URL(string: String(format: "om:/%@", universalLink.path))
self.url = URL(string: universalLink.absoluteString
.replacingOccurrences(of: "http://omaps.app", with: "om:/")
.replacingOccurrences(of: "https://omaps.app", with: "om:/"))
return handleDeepLink(url: self.url!)
}