Pārlūkot izejas kodu

add fallback to OSM link

Simon Laux 2 gadi atpakaļ
vecāks
revīzija
6d24bc0fb9

+ 7 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -291,7 +291,13 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
                             UIApplication.shared.open(url, options: [:], completionHandler: nil)
                         } else {
                             if let url = URL(string: "geo:\(location)") {
-                                UIApplication.shared.open(url, options: [:], completionHandler: nil)
+                                if UIApplication.shared.canOpenURL(url) {
+                                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
+                                }else {
+                                    if let url = URL(string: "https://www.openstreetmap.org/#map=16/33.89041/35.50664\(location.replacingOccurrences(of: ",", with: "/"))") {
+                                        UIApplication.shared.open(url, options: [:], completionHandler: nil)
+                                    }
+                                }
                             }
                         }
                     }

+ 1 - 0
deltachat-ios/Info.plist

@@ -111,6 +111,7 @@
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>om</string>
+		<string>geo</string>
 	</array>
 </dict>
 </plist>