# GoogleNavigation Framework Reference

# GMSNavigationTransactionRecorder

    @interface GMSNavigationTransactionRecorder : NSObject

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.
- `


  ### [+sharedInstance](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationTransactionRecorder#/c:objc(cs)GMSNavigationTransactionRecorder(cm)sharedInstance)


  ` 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 `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices.html` `+provideAPIKey:` has not been called.

  #### Declaration

  Swift

      class func sharedInstance() -> GMSNavigationTransactionRecorder

  Objective-C

      + (nonnull GMSNavigationTransactionRecorder *)sharedInstance;

- `


  ### [-recordPickupAtWaypoint:forTransactionIDs:withErrorHandler:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationTransactionRecorder#/c:objc(cs)GMSNavigationTransactionRecorder(im)recordPickupAtWaypoint:forTransactionIDs:withErrorHandler:)


  ` 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.

  <br />

  This method should be called if and only if your company is billed by Google on a
  per-transaction basis.

  #### Declaration

  Swift

      func recordPickup(at waypoint: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html?, forTransactionIDs transactionIDs: [String], withErrorHandler errorHandler: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationTransactionRecorderErrorHandler.html? = nil)

  Objective-C

      - (void)recordPickupAtWaypoint:(nullable https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html *)waypoint
                   forTransactionIDs:(nonnull NSArray<NSString *> *)transactionIDs
                    withErrorHandler:
                        (nullable https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationTransactionRecorderErrorHandler.html)
                            errorHandler;

  #### Parameters

  |---|---|
  | ` waypoint ` | The `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html` 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. |

- `


  ### [-recordDropoffAtWaypoint:forTransactionIDs:withErrorHandler:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationTransactionRecorder#/c:objc(cs)GMSNavigationTransactionRecorder(im)recordDropoffAtWaypoint:forTransactionIDs:withErrorHandler:)


  ` 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.

  <br />

  This method should be called if and only if your company is billed by Google on a
  per-transaction basis.

  #### Declaration

  Swift

      func recordDropoff(at waypoint: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html?, forTransactionIDs transactionIDs: [String], withErrorHandler errorHandler: https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationTransactionRecorderErrorHandler.html? = nil)

  Objective-C

      - (void)recordDropoffAtWaypoint:(nullable https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html *)waypoint
                    forTransactionIDs:(nonnull NSArray<NSString *> *)transactionIDs
                     withErrorHandler:
                         (nullable https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Type-Definitions/GMSNavigationTransactionRecorderErrorHandler.html)
                             errorHandler;

  #### Parameters

  |---|---|
  | ` waypoint ` | The `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationWaypoint.html` 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. |

- `


  ### [+generateTransactionID](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationTransactionRecorder#/c:objc(cs)GMSNavigationTransactionRecorder(cm)generateTransactionID)


  ` Generate a new unique transaction ID.

  #### Declaration

  Swift

      class func generateTransactionID() -> String

  Objective-C

      + (nonnull NSString *)generateTransactionID;

- `


  ### [-init](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSNavigationTransactionRecorder#/c:objc(cs)GMSNavigationTransactionRecorder(im)init)


  ` Unavailable
  Init is unavailable. Use +sharedInstance to acquire an instance.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;