Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix for iOS location permission check

Michael Rademaker9a6fb19c124a
diff --git a/console/iOS/ORLib/ORLib/ORViewController.swift b/console/iOS/ORLib/ORLib/ORViewController.swift
index b58db17b4..72d01a1c1 100644
--- a/console/iOS/ORLib/ORLib/ORViewController.swift
+++ b/console/iOS/ORLib/ORLib/ORViewController.swift
@@ -260,8 +260,7 @@ extension ORViewcontroller: WKScriptMessageHandler {
geofenceProvider?.refreshGeofences()
case Actions.getLocation:
geofenceProvider?.getLocation(callback: { locationData in
- if let coordinates = locationData["data"], coordinates == nil {//weird comparion needed for nil value in dict where key does exist.
- } else {
+ if (locationData["data"] as? [String:Any]) == nil {
let alertController = UIAlertController(title: NSLocalizedString(LocalizableString.LocationPermissionTitle, comment: ""),
message: NSLocalizedString(LocalizableString.LocationPermissionMessage, comment: ""),
preferredStyle: .alert)