Class
MobiledgeXiOSLibrary.MobiledgeXLocation
public class MobiledgeXLocation
MobiledgeX Location Services for easy location service integration with application
Relationships
Member Of
MobiledgeXiOSLibrary
Swift MobiledgeX SDK namespace Used for "namespacing" purposes to prevent naming conflicts from common names (Util, NetworkInterface, etc.)
Nested Types
MobiledgeXiOSLibrary.MobiledgeXLocation.ServiceType
Types of Location ServiceTypes, reflects built-in methods that iOS uses to get location Visits: Only updates location when user spends time at location and then moves (the most power-efficient) SignificantChange : Updates location when user's location significantly changes Standard: For real time location updates (requires most power)
MobiledgeXiOSLibrary.MobiledgeXLocation.MobiledgeXLocationError
Methods
startLocationServices(serviceType:)
public static func startLocationServices(serviceType: ServiceType = ServiceType.SignificantChange) -> Promise<Bool>
Begin monitoring location services. Default serviceType is SignificantChange
stopLocationServices()
public static func stopLocationServices()
checkLocationPermissions()
public static func checkLocationPermissions() -> Bool
Checks to see what Location Permissions user has accepted (called before Location Services is started) Will only return true (ie. that location services can start) if user has authorized location services always or when in app use Otherwise the user has not accepted valid location permissions and we cannot start location services
getLastLocation()
public static func getLastLocation() -> MobiledgeXiOSLibrary.MatchingEngine.Loc?
Returns the last location in the form of a MobiledgeXiOSLibrary.MatchingEngine.Loc object
getLastISOCountryCode()
public static func getLastISOCountryCode() -> String?
Returns the ISO country code of the last location