Class
MobiledgeXiOSLibrary.MatchingEngine
public class MatchingEngine
MatchingEngine class MobiledgeX MatchingEngine APIs
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.MatchingEngine.DynamicLocGroupRequest
MobiledgeXiOSLibrary.MatchingEngine.DynamicLocGroupReply
MobiledgeXiOSLibrary.MatchingEngine.AppInstListRequest
AppInstListRequest struct Request object sent via GetAppInstList from client side to DME Request requires session_cookie from RegisterClientReply, gps_location, and carrier_name
MobiledgeXiOSLibrary.MatchingEngine.AppInstListReply
AppInstListReply struct Reply object received via GetAppInstList If an application instance exists, this will return AI_SUCCESS. Will provide information about all application instances deployed on specified carrier network
MobiledgeXiOSLibrary.MatchingEngine.CloudletLocation
Object returned in AppInstListReply cloudlets field The geo-location of Cloudlets (resources) within the Operator's Telco infrastructure, where Developers can create and deploy application instances to the available Cloudlets.
MobiledgeXiOSLibrary.MatchingEngine.Appinstance
Object returned in CloudletLocation appinstances field Information about specific app instances
MobiledgeXiOSLibrary.MatchingEngine.FindCloudletRequest
FindCloudletRequest struct Request object sent via FindCloudlet from client side to DME Request requires session_cookie from RegisterClientReply, gps_location, and carrier_name
MobiledgeXiOSLibrary.MatchingEngine.FindCloudletReply
FindCloudletReply struct Reply object received via FindCloudlet If application instance exists, this will return FIND_FOUND and contain information about the application instance.
MobiledgeXiOSLibrary.MatchingEngine.FindCloudletMode
Two modes to call FindCloudlet. First is Proximity (default) which finds the nearest cloudlet based on gps location with application instance Second is Performance. This mode will test all cloudlets with application instance deployed to find cloudlet with lowest latency. This mode takes longer to finish because of latency test.
MobiledgeXiOSLibrary.MatchingEngine.GetConnectionError
Errors on GetConnection
MobiledgeXiOSLibrary.MatchingEngine.EdgeError
Errors related to trying to get a telco edge connection
MobiledgeXiOSLibrary.MatchingEngine.GetConnectionProtocol
L4 and L7 protocols supported by MobiledgeX iOS GetConnection
MobiledgeXiOSLibrary.MatchingEngine.APIPaths
MobiledgeXiOSLibrary.MatchingEngine.DMEConstants
MobiledgeXiOSLibrary.MatchingEngine.MatchingEngineError
MatchingEngine API errors
MobiledgeXiOSLibrary.MatchingEngine.InvalidTokenServerTokenError
Occurs when VerifyLocation API is unable to communicate with token server
MobiledgeXiOSLibrary.MatchingEngine.UrlSessionError
Occurs on bad HTTP requests
MobiledgeXiOSLibrary.MatchingEngine.IDTypes
IDTypes used for unique_id_type in RegisterClientRequest??
MobiledgeXiOSLibrary.MatchingEngine.ReplyStatus
Values for RegisterClientReply, DynamicLocGroupReply, and QosPositionKpiReply status field
MobiledgeXiOSLibrary.MatchingEngine.AppPort
Object returned in ports of several API replies
MobiledgeXiOSLibrary.MatchingEngine.LProto
Values for AppPort proto field
MobiledgeXiOSLibrary.MatchingEngine.Timestamp
Object used in timestamp field of Loc
MobiledgeXiOSLibrary.MatchingEngine.Loc
Object used and returned in gps_location field of serveral API requests and replies
MobiledgeXiOSLibrary.MatchingEngine.QosPositionRequest
QosPositionKpiRequest struct Request object sent via GetQosPositionKpi from client side to DME Request requires session_cookie from RegisterClientReply and an array of QosPositions
MobiledgeXiOSLibrary.MatchingEngine.QosPosition
Object in positions field in QosPositionRequest Object that contains gps location and id for that gps location
MobiledgeXiOSLibrary.MatchingEngine.BandSelection
Object in QosPositionRequest band_selection field Each field's value is an array of Strings Supported band values
MobiledgeXiOSLibrary.MatchingEngine.QosPositionKpiReply
QosPositionKpiReply struct Reply object received via GetQosPositionKpi If an application instance exists, this will return RS_SUCCESS. Will provide quality of service information for gps locations specified
MobiledgeXiOSLibrary.MatchingEngine.QosPositionKpiResult
Object returned in position_results field of QosPositionKpiReply Qos results for specific location
MobiledgeXiOSLibrary.MatchingEngine.RegisterClientRequest
RegisterClientRequest struct Request object sent via RegisterClient from client side to DME Request requires org_name, app_name, and app_vers
MobiledgeXiOSLibrary.MatchingEngine.RegisterClientReply
RegisterClientReply struct Reply object received via RegisterClient If application exists, this will return RS_SUCCESS and contain a session cookie to be used in other DME APIs
MobiledgeXiOSLibrary.MatchingEngine.VerifyLocationRequest
VerifyLocationRequest struct Request object sent via VerifyLocation from client side to DME
MobiledgeXiOSLibrary.MatchingEngine.VerifyLocationReply
VerifyLocationReply struct Reply object received via VerifyLocation If verified, will return LOC_VERIFIED and CONNECTED_TO_SPECIFIED_TOWER Also contains information about accuracy of provided gps location
Initializers
init()
public init()
MatchingEngine constructor
Properties
state
var state: MatchingEngineState
Methods
createGetAppInstListRequest(gpsLocation:carrierName:cellID:tags:)
public func createGetAppInstListRequest(gpsLocation: Loc, carrierName: String?, cellID: uint? = nil, tags: [String: String]? = nil) throws -> AppInstListRequest
createGetAppInstListRequest Creates the AppInstListRequest object that will be used in GetAppInstList
Parameters
Name | Type | Description |
---|---|---|
gpslocation | A dictionary with at least longitude and latitude key values. |
|
carrierName | String? |
Carrier name. This value can change depending on cell tower. |
cellID | uint? |
Optional cellID |
tags | [String: String]? |
Optional dict |
Returns
AppInstListRequest
getAppInstList(request:)
public func getAppInstList(request: AppInstListRequest) -> Promise<AppInstListReply>
API getAppInstList Returns a list of the developer's backend instances deployed on the specified carrier's network. If carrier was "", returns all backend instances regardless of carrier network. This is used internally in FindCloudlet Performance mode to grab the list of cloudlets to test.
Parameters
Name | Type | Description |
---|---|---|
request | AppInstListRequest |
AppInstListRequest from createGetAppInstListRequest |
Returns
Promise
getAppInstList(host:port:request:)
public func getAppInstList(host: String, port: UInt16, request: AppInstListRequest) -> Promise<AppInstListReply>
GetAppInstList overload with hardcoded DME host and port. Only use for testing.
createFindCloudletRequest(gpsLocation:carrierName:cellID:tags:)
public func createFindCloudletRequest(gpsLocation: Loc, carrierName: String? = "", cellID: uint? = nil, tags: [String: String]? = nil) throws -> FindCloudletRequest
createFindCloudletRequest Creates the FindCloudletRequest object that will be used in the FindCloudlet function. The FindCloudletRequest object wraps the parameters that have been provided to this function.
Parameters
Name | Type | Description |
---|---|---|
carrierName | String? |
carrierName |
gpslocation | gpslocation |
Returns
FindCloudletRequest
findCloudlet(request:mode:)
@available(iOS 13.0, *) public func findCloudlet(request: FindCloudletRequest, mode: FindCloudletMode = FindCloudletMode.PROXIMITY) -> Promise<FindCloudletReply>
API findCloudlet FindCloudlet returns information needed for the client app to connect to an application backend deployed through MobiledgeX. If there is an application backend instance found, FindCloudetReply will contain the fqdn of the application backend and an array of AppPorts (with information specific to each application backend endpoint)
Takes a FindCloudlet request, and contacts the specified Distributed MatchingEngine host and port for the current carrier, if any.
Parameters
Name | Type | Description |
---|---|---|
request | FindCloudletRequest |
FindCloudletRequest from createFindCloudletRequest. |
Returns
Promise
findCloudlet(host:port:request:mode:)
@available(iOS 13.0, *) public func findCloudlet(host: String, port: UInt16, request: FindCloudletRequest, mode: FindCloudletMode = FindCloudletMode.PROXIMITY) -> Promise<FindCloudletReply>
FindCloudlet overload with hardcoded DME host and port. Only use for testing.
getTCPConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getTCPConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<CFSocket>
getTCPConnection Get a TCP socket bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getBSDTCPConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getBSDTCPConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<MobiledgeXiOSLibrary.Socket>
getBSDTCPConnection Gets a BSD TCP socket bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse<MobiledgeXiOSLibrary.Socket>
getTCPTLSConnection(findCloudletReply:appPort:desiredPort:timeout:)
@available(iOS 13.0, *) public func getTCPTLSConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<NWConnection>
getTCPTLSConnection Gets a TCP socket that is tls configured bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getUDPConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getUDPConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<CFSocket>
getUDPConnection Get a UDP socket bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getBSDUDPConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getBSDUDPConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<MobiledgeXiOSLibrary.Socket>
getBSDUDPConnection Get a BSD UDP socket bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse<MobiledgeXiOSLibrary.Socket>
getUDPDTLSConnection(findCloudletReply:appPort:desiredPort:timeout:)
@available(iOS 13.0, *) public func getUDPDTLSConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<NWConnection>
getUDPDTLSConnection Get a UDP socket with DTLS configured bound to the local cellular interface and connected to the application's backend server. If no exceptions thrown and object is not null, the socket is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getHTTPClient(findCloudletReply:appPort:desiredPort:timeout:)
public func getHTTPClient(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<URLRequest>
getHTTPClient Gets an HTTPClient (URLRequest) object that is edgeEnabled. If the device is not telco edge enabled (ie. not using cellular data path), error will be returned. If no exceptions thrown and object is not null, the Client is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getHTTPSClient(findCloudletReply:appPort:desiredPort:timeout:)
public func getHTTPSClient(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<URLRequest>
getHTTPSClient Gets an HTTPSClient (URLRequest) object that is tls configured that is edgeEnabled. If the device is not telco edge enabled (ie. not using cellular data path), error will be returned. If no exceptions thrown and object is not null, the Client is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getWebsocketConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getWebsocketConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<SocketManager>
getWebsocketConnection Gets a websocket client that is edgeEnabled. If the device is not telco edge enabled (ie. not using cellular data path), error will be returned. If no exceptions thrown and object is not null, the Client is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
getSecureWebsocketConnection(findCloudletReply:appPort:desiredPort:timeout:)
public func getSecureWebsocketConnection(findCloudletReply: FindCloudletReply, appPort: AppPort, desiredPort: Int = 0, timeout: Double = 10000) -> Promise<SocketManager>
getSecureWebsocketConnection Gets a websocket client that is tls configured that is edgeEnabled. If the device is not telco edge enabled (ie. not using cellular data path), error will be returned. If no exceptions thrown and object is not null, the Client is ready to send application data to backend.
-
Parameters
- findCloudletReply: FindCloudletReply from findCloudlet
- appPort: Specific AppPort wanted from FindCloudletReply
- desiredPort: Optional desired port. If none specified, will use public port in given appPort
- timeout: Optional timeout. Default is 10 seconds
Returns
Promse
isEdgeEnabled(proto:)
public func isEdgeEnabled(proto: GetConnectionProtocol) -> EdgeError?
Checks whether device will use cellular data path If using L4 getConnection protocol, GetConnection functions will bind local socket to cellular network interface. So as long as the device has a cellular interface up, it is edgeEnabled If using L7 getConnection protocol (where we cannot control the network interface), we must check to make sure the device will not default to wifi
getHost(findCloudletReply:appPort:)
public func getHost(findCloudletReply: FindCloudletReply, appPort: AppPort) throws -> String
Returns the host of the developers app backend based on the findCloudletReply and appPort provided. This function is called by L4 GetConnection functions, but can be called by developers if they are using their own communication client (use GetPort as well)
getPort(appPort:desiredPort:)
public func getPort(appPort: AppPort, desiredPort: Int = 0) throws -> UInt16
Returns the port of the developers app backend service based on the appPort provided. An optional desiredPort parameter is provided if the developer wants a specific port within their appPort port range (if none provided, the function will default to the public_port field in the AppPort). This function is called by L4 GetConnection functions, but can be called by developers if they are using their own communication client (use GetHost as well).
createUrl(findCloudletReply:appPort:proto:desiredPort:path:)
public func createUrl(findCloudletReply: FindCloudletReply, appPort: AppPort, proto: String, desiredPort: Int = 0, path: String = "") throws -> String
Returns the L7 path of the developers app backend based on the the findCloudletReply and appPort provided. The desired port number must be specified by the developer (use -1 if you want the SDK to choose a port number). An L7 protocol must also be provided (eg. http, https, ws, wss). The path variable is optional and will be appended to the end of the url. This function is called by L7 GetConnection functions, but can be called by developers if they are using their own communication client. Example return value: https://example.com:8888
allowSelfSignedCerts()
public func allowSelfSignedCerts()
disableSelfSignedCerts()
public func disableSelfSignedCerts()
getAppPortsByProtocol(findCloudletReply:proto:)
public func getAppPortsByProtocol(findCloudletReply: FindCloudletReply, proto: LProto) throws -> [UInt16: AppPort]?
Returns dictionary: key -> internal port, value -> AppPort
getTCPAppPorts(findCloudletReply:)
public func getTCPAppPorts(findCloudletReply: FindCloudletReply) throws -> [UInt16: AppPort]?
Return dictionary of TCP AppPorts given in findCloudletReply
getUDPAppPorts(findCloudletReply:)
public func getUDPAppPorts(findCloudletReply: FindCloudletReply) throws -> [UInt16: AppPort]?
Return dictionary of UDP AppPorts given in findCloudletReply
postRequest(uri:request:type:)
public func postRequest<Request: Encodable, Reply: Decodable>(uri: String, request: Request, type: Reply.Type) -> Promise<Reply>
validateGpsLocation(gpsLocation:)
public func validateGpsLocation(gpsLocation: Loc) throws -> Bool
getCarrierName()
public func getCarrierName() -> String
Retrieve the carrier name of the cellular network interface (MCC and MNC) Returns the carrier's mcc+mnc which is mapped to a carrier in the backend (ie. 26201 -> GDDT). MCC stands for Mobile Country Code and MNC stands for Mobile Network Code. If useWifiOnly or cellular is off + wifi is up, this will return "". Empty string carrierName is the alias for any, which will search all carriers for application instances.
generateDmeHostAddress()
public func generateDmeHostAddress() throws -> String
This will generate the dme host name based on GetMccMnc() -> "mcc-mnc.dme.mobiledgex.net". If getMccMnc fails or returns null, this will return a fallback dme host: "wifi.dme.mobiledgex.net"(this is the EU + GDDT DME). This function is used by any DME APIs calls where no host and port overloads are provided.
generateFallbackDmeHost(carrierName:)
public func generateFallbackDmeHost(carrierName: String?) -> String
verifyDmeHost(host:)
public func verifyDmeHost(host: String) throws
Makes sure host generated in generateDmeHostAddress is valid DNS Lookup
generateBaseUri(carrierName:port:)
public func generateBaseUri(carrierName: String, port: UInt16) throws -> String
generateBaseUri(host:port:)
public func generateBaseUri(host: String, port: UInt16) -> String
getDeviceInfo()
public func getDeviceInfo() -> [String: String]
Device info will be sent as tags parameter in RegisterClient
getNetworkDataType()
public func getNetworkDataType() -> String?
NetworkDataType is sent along with latency information when sending samples to DME
createQosKPIRequest(requests:lteCategory:bandSelection:cellID:tags:)
public func createQosKPIRequest(requests: [QosPosition], lteCategory: Int32? = nil, bandSelection: BandSelection? = nil, cellID: uint? = nil, tags: [String: String]? = nil) throws -> QosPositionRequest
createQosKPIRequest Creates the QosPositionRequest object that will be used in CreateQosPositionRequest
Parameters
Name | Type | Description |
---|---|---|
requests | [QosPosition] |
QosPositions (Dict: id -> gps location) |
lteCategory | Int32? |
Optional lteCategory |
bandSelection | BandSelection? |
Optional BandSelection |
cellID | uint? |
Optional cellID |
tags | [String: String]? |
Optional dict |
Returns
QosPositionRequest
postQosPositionRequest(uri:request:)
public func postQosPositionRequest(uri: String, request: QosPositionRequest) -> Promise<QosPositionKpiReply>
getQosKPIPosition(request:)
public func getQosKPIPosition(request: QosPositionRequest) -> Promise<QosPositionKpiReply>
API getQosKPIPosition Returns quality of service metrics for each location provided in qos position request
Takes a QosKPIRequest request, and contacts the Distributed MatchingEngine host for quality of service at specified locations
Parameters
Name | Type | Description |
---|---|---|
request | QosPositionRequest |
QosKPIRequest struct from createQosKPIRequest. |
Returns
Promise
getQosKPIPosition(host:port:request:)
public func getQosKPIPosition(host: String, port: UInt16, request: QosPositionRequest) -> Promise<QosPositionKpiReply>
API getQosKPIPosition GetQosPositionKpi overload with hardcoded DME host and port. Only use for testing.
Parameters
Name | Type | Description |
---|---|---|
host | String |
host override of the dme host server. DME must be reachable from current carrier. |
port | UInt16 |
port override of the dme server port |
request | QosPositionRequest |
QosKPIRequest dictionary, from createQosKPIRequest. |
Returns
Promise
registerAndFindCloudlet(orgName:appName:appVers:gpsLocation:carrierName:authToken:cellID:tags:mode:)
@available(iOS 13.0, *) public func registerAndFindCloudlet(orgName: String, appName: String?, appVers: String?, gpsLocation: Loc, carrierName: String? = "", authToken: String? = nil, cellID: UInt32? = nil, tags: [String: String]? = nil, mode: FindCloudletMode = FindCloudletMode.PROXIMITY) -> Promise<FindCloudletReply>
registerAndFIndCloudlet FindCloudlet returns information needed for the client app to connect to an application backend deployed through MobiledgeX. If there is an application backend instance found, FindCloudetReply will contain the fqdn of the application backend and an array of AppPorts (with information specific to each application backend endpoint)
Takes a FindCloudlet request, and contacts the specified Distributed MatchingEngine host and port for the current carrier, if any.
Parameters
Name | Type | Description |
---|---|---|
orgName | String |
orgName |
appName | String? |
appName |
appVers | String? |
appVers |
gpsLocation | Loc |
Loc |
carrierName | String? |
Optional carrierName |
authToken | String? |
Optional authToken |
cellID | UInt32? |
Optional cellID |
tags | [String: String]? |
Optional dict |
mode | FindCloudletMode |
Optional FindCloudletMode (default to Proximity) |
Returns
Promise
registerAndFindCloudlet(host:port:orgName:appName:appVers:gpsLocation:carrierName:authToken:cellID:tags:mode:)
@available(iOS 13.0, *) public func registerAndFindCloudlet(host: String, port: UInt16, orgName: String, appName: String?, appVers: String?, gpsLocation: Loc, carrierName: String? = "", authToken: String? = nil, cellID: UInt32? = nil, tags: [String: String]? = nil, mode: FindCloudletMode = FindCloudletMode.PROXIMITY) -> Promise<FindCloudletReply>
registerAndFindCloudlet overload with hardcoded DME host and port. Only use for testing. This API cannot be used for Non-Platform APPs.
createRegisterClientRequest(orgName:appName:appVers:authToken:cellID:tags:)
public func createRegisterClientRequest(orgName: String, appName: String?, appVers: String?, authToken: String? = nil, cellID: UInt32? = nil, tags: [String: String]? = nil) -> RegisterClientRequest
API createRegisterClientRequest Creates the RegisterClientRequest object that will be used in the RegisterClient function.The RegisterClientRequest object wraps the parameters that have been provided to this function.
Parameters
Name | Type | Description |
---|---|---|
orgName | String |
Name of the developer |
appName | String? |
Name of the application |
appVers | String? |
Version of the application. |
authToken | String? |
An optional opaque string to authenticate the client. |
Returns
RegisterClientRequest
registerClient(request:)
public func registerClient(request: RegisterClientRequest) -> Promise<RegisterClientReply>
API registerClient First DME API called. This will register the client with the MobiledgeX backend and check to make sure that the app that the user is running exists. (ie. This confirms that CreateApp in Console/Mcctl has been run successfully). RegisterClientReply contains a session cookie that will be used (automatically) in later API calls. It also contains a uri that will be used to get the verifyLocToken used in VerifyLocation.
Takes a RegisterClient request, and contacts the Distributed MatchingEngine host for the current carrier, if any.
Parameters
Name | Type | Description |
---|---|---|
request | RegisterClientRequest |
RegisterClientRequest struct, from createRegisterClientReqwuest. |
Returns
Promise
registerClient(host:port:request:)
public func registerClient(host: String, port: UInt16, request: RegisterClientRequest) -> Promise<RegisterClientReply>
API registerClient RegisterClient overload with hardcoded DME host and port. Only use for testing.
Takes a RegisterClient request, and contacts the specified Distributed MatchingEngine host and port for the current carrier, if any.
Parameters
Name | Type | Description |
---|---|---|
host | String |
host override of the dme host server. DME must be reachable from current carrier. |
port | UInt16 |
port override of the dme server port |
request | RegisterClientRequest |
RegisterClientRequest struct, from createRegisterClientReqwuest. |
Returns
Promise
createVerifyLocationRequest(gpsLocation:carrierName:cellID:tags:)
public func createVerifyLocationRequest(gpsLocation: Loc, carrierName: String?, cellID: uint? = nil, tags: [String: String]? = nil) throws -> VerifyLocationRequest
createVerifyLocationRequest Creates the VerifyLocationRequest object that will be used in VerifyLocation
-
gpsLocation; Loc
Parameters
Name | Type | Description |
---|---|---|
carrierName | String? |
carrierName |
cellID | uint? |
Optional cellID |
tags | [String: String]? |
Optional dict |
Returns
VerifyLocationRequest
verifyLocation(request:)
public func verifyLocation(request: VerifyLocationRequest) -> Promise<VerifyLocationReply>
API: VerifyLocation Makes sure that the user's location is not spoofed based on cellID and gps location. Returns the Cell Tower status (CONNECTED_TO_SPECIFIED_TOWER if successful) and Gps Location status (LOC_VERIFIED if successful). Also provides the distance between where the user claims to be and where carrier believes user to be (via gps and cell id) in km.
Parameters
Name | Type | Description |
---|---|---|
request | VerifyLocationRequest |
VerifyLocationRequest from createVerifyLocation |
Returns
Promise
verifyLocation(host:port:request:)
public func verifyLocation(host: String, port: UInt16, request: VerifyLocationRequest) -> Promise<VerifyLocationReply>
VerifyLocation overload with hardcoded DME host and port. Only use for testing.