AI-generated Key Takeaways
-
This page details globally available type definitions for the Mobility Driver SDK for iOS.
-
GMTDAuthTokenFetchCompletionHandlerprovides a completion handler that returns an authorization token or an error. -
GMTDDeliveryTaskManagerCompletionHandleris a completion handler for creating and updating delivery tasks, returning the task or an error. -
GMTDDeliveryVehicleManagerCompletionHandlerhandles the creation and retrieval of delivery vehicles, providing the vehicle or an error upon completion. -
GMTDFleetEngineIDStringandGMTSFleetEngineIDStringdefine string ID fields that must adhere to specific UTF-8 formatting rules to prevent request failures, with the latter being deprecated.
Type-Definitions
The following type definitions are available globally.
-
Completion handler called when an authorization token is available.
Declaration
Swift
typealias GMTDAuthTokenFetchCompletionHandler = (String?, (any Error)?) -> VoidObjective-C
typedef void (^GMTDAuthTokenFetchCompletionHandler)(NSString *_Nullable, NSError *_Nullable)Parameters
authTokenThe authorization token. If an error occurs, this parameter is null.
errorThe error that occurs if any.
-
Completion handler type definition for the create and update task operations.
Declaration
Swift
typealias GMTDDeliveryTaskManagerCompletionHandler = (GMTDDeliveryTask?, (any Error)?) -> VoidObjective-C
typedef void (^GMTDDeliveryTaskManagerCompletionHandler)( GMTDDeliveryTask *_Nullable, NSError *_Nullable)Parameters
taskThe created or updated delivery task. If the requests fails, is null.
errorThe error that occurs. If the request succeeds, is null.
-
Completion handler type definition for the create and get vehicle operations.
Declaration
Swift
typealias GMTDDeliveryVehicleManagerCompletionHandler = (GMTDDeliveryVehicle?, (any Error)?) -> VoidObjective-C
typedef void (^GMTDDeliveryVehicleManagerCompletionHandler)( GMTDDeliveryVehicle *_Nullable, NSError *_Nullable)Parameters
vehicleThe created or retrieved delivery vehicle. If request fails, is null.
errorThe error that occurs. If request succeeds, is null.
-
Handler for updating stops via the
GMTDDeliveryVehicleReporter.Declaration
Swift
typealias GMTDVehicleReporterStopCompletionHandler = ([GMTDVehicleStop]?, (any Error)?) -> VoidObjective-C
typedef void (^GMTDVehicleReporterStopCompletionHandler)( NSArray<GMTDVehicleStop *> *_Nullable, NSError *_Nullable)Parameters
stopsThe updated stops.
errorThe error that occurs if any.
-
Specifies an ID field that is of type String.
The SDK receives string data from other APIs and passes that data unmodified to Fleet Engine. However, Fleet Engine requires that some string-typed data conform to specific rules. Data passed through the SDK to Fleet Engine can result in request failure if the data format does not conform to Fleet Engine rules. To prevent request failures to Fleet Engine, use this typedef to identify which fields from incoming calls must follow the following formatting rules:
- The string must be a valid UTF-8 string in UTF normalized form C (see http://www.unicode.org/reports/tr15/).
- The string must be no longer than 64 characters in length.
- The string must not contain the characters ‘/’, ‘:’, ‘?’, ‘,’, or ‘#’.
You are responsible for ensuring that when your client makes calls to Fleet Engine SDKs, ID strings conform to the restrictions above. The SDK itself will pass the input values unmodified to the backend.
Declaration
Objective-C
typedef NSString GMTDFleetEngineIDString -
Deprecated
Specifies an ID field that is of type String.
The SDK receives string data from other APIs and passes that data unmodified to Fleet Engine. However, Fleet Engine requires that some string-typed data conform to specific rules. Data passed through the SDK to Fleet Engine can result in request failure if the data format does not conform to Fleet Engine rules. To prevent request failures to Fleet Engine, use this typedef to identify which fields from incoming calls must follow the following formatting rules:
- The string must be a valid UTF-8 string in UTF normalized form C (see http://www.unicode.org/reports/tr15/).
- The string must be no longer than 64 characters in length.
- The string must not contain the characters ‘/’, ‘:’, ‘?’, ‘,’, or ‘#’.
You are responsible for ensuring that when your client makes calls to Fleet Engine SDKs, ID strings conform to the restrictions above. The SDK itself will pass the input values unmodified to the backend.
Declaration
Objective-C
typedef NSString GMTSFleetEngineIDString