Overview
Contains methods for recording transactions.
This class should only be used if you are a Mobility Services customer and are billed by Google on a per-transaction basis.
Public Member Functions | |
(void) | - recordPickupAtWaypoint:forTransactionIDs:withErrorHandler: |
You should call this function each time a passenger or a delivery is picked up. | |
(void) | - recordDropoffAtWaypoint:forTransactionIDs:withErrorHandler: |
You should call this function each time a passenger is dropped-off or a delivery is delivered. | |
Static Public Member Functions | |
(GMSNavigationTransactionRecorder *) | + sharedInstance |
Returns a shared singleton GMSNavigationTransactionRecorder instance. | |
(NSString *) | + generateTransactionID |
Generate a new unique transaction ID. |
Member Function Documentation
Returns a shared singleton GMSNavigationTransactionRecorder instance.
This singleton is held weakly and may be deallocated if an application does not keep a strong reference. You must call this function only on the main thread.
This method will throw an exception if GMSServices +provideAPIKey: has not been called.
- (void) recordPickupAtWaypoint: | (nullable GMSNavigationWaypoint *) | waypoint | |
forTransactionIDs: | (NSArray< NSString * > *) | transactionIDs | |
withErrorHandler: | (nullable GMSNavigationTransactionRecorderErrorHandler) | errorHandler | |
You should call this function each time a passenger or a delivery is picked up.
You should populate the transactionIDs parameter with a unique ID for each transaction that applies to this event. You must call this function only on the main thread.
This method should be called if and only if your company is billed by Google on a per-transaction basis.
- Parameters:
-
waypoint The GMSNavigationWaypoint at which the pickup is occurring, or nil if there was no guidance session leading to this pickup. transactionIDs One or more transaction IDs to which this pickup applies. The transaction ID must be unique for each billable transaction. Transaction IDs must contain at least one and at most 64 characters. errorHandler A block that will be invoked asynchronously on the main thread if an error occurs while recording the pickup.
- (void) recordDropoffAtWaypoint: | (nullable GMSNavigationWaypoint *) | waypoint | |
forTransactionIDs: | (NSArray< NSString * > *) | transactionIDs | |
withErrorHandler: | (nullable GMSNavigationTransactionRecorderErrorHandler) | errorHandler | |
You should call this function each time a passenger is dropped-off or a delivery is delivered.
You should populate the transactionIDs parameter with a unique ID for each transaction that applies to this event. You must call this function only on the main thread.
This method should be called if and only if your company is billed by Google on a per-transaction basis.
- Parameters:
-
waypoint The GMSNavigationWaypoint at which the dropoff is occurring, or nil if there was no guidance session leading to this dropoff. transactionIDs One or more transaction IDs to which this dropoff applies. The transaction ID must be unique for each billable transaction. Transaction IDs must contain at least one and at most 64 characters. errorHandler A block that will be invoked asynchronously on the main thread if an error occurs while recording the dropoff.
+ (NSString *) generateTransactionID |
Generate a new unique transaction ID.