Swift Rest SDK Documentation Beta

Class Mobiledge​XiOSLibrary.​Mobiledge​XLocation

public class MobiledgeXLocation

MobiledgeX Location Services for easy location service integration with application

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

start​Location​Services(service​Type:​)

public static func startLocationServices(serviceType: ServiceType = ServiceType.SignificantChange) -> Promise<Bool>

Begin monitoring location services. Default serviceType is SignificantChange

stop​Location​Services()

public static func stopLocationServices()

check​Location​Permissions()

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

get​Last​Location()

public static func getLastLocation() -> MobiledgeXiOSLibrary.MatchingEngine.Loc?

Returns the last location in the form of a MobiledgeXiOSLibrary.MatchingEngine.Loc object

get​Last​ISOCountry​Code()

public static func getLastISOCountryCode() -> String?

Returns the ISO country code of the last location