CSUserSessionDelegate

@protocol CSUserSessionDelegate <CSSessionDelegate>

The CSUserSession’s delegate object will get various callbacks when events happen in the CSUserSession.

  •   This method is on the CSUserSession delegate after app initialization and resume when the user
      is near a site where the associate can be notified of the user arrival.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        canNotifyMonitoringSessionUserAtSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, canNotifyMonitoringSessionUserAt site: CSSite!)
  • If a delegate is set and the method is implemented, then the delegate will receive a callback when the user is approaching a site which is currently tracked for a trip.

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        userApproachingSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, userApproachingSite site: CSSite!)
  • If a delegate is set and the method is implemented, then the delegate will receive a callback when the user has arrived at a site which is currently tracked for a trip.

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        userArrivedAtSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, userArrivedAt site: CSSite!)
  • If a delegate is set and there was a error completing an action, the delegate will get callback with the error reason.

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        encounteredError:(nonnull NSError *)error
            forOperation:(CSUserSessionAction)customerSessionAction;

    Swift

    optional func session(_ session: Any!, encounteredError error: Any!, forOperation customerSessionAction: Any!)
  •   If a delegate is set and the trackedSites are updated, the delegate will get this callback. The tracked
      sites are updated on launch when a trackngIdentfier is set or when the application code explicitly calls the updateTripsFromServer
      method.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        updatedTrackedSites:(nonnull NSSet<CSSite *> *)trackedSites;

    Swift

    optional func session(_ session: Any!, updatedTrackedSites trackedSites: Any!)
  •   If a delegate is set and the method is implemented you will get a callback when a trip has been successfully started.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        tripStartedForSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, tripStartedFor site: CSSite!)
  •   If a delegate is set and the method is implemented you will get a callback the mockTrip has successfully started.
      method.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        mockTripStartedForSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, mockTripStartedFor site: CSSite!)
  •   If a delegate is set and the method is implemented you will get a callback on errors while simulating the mock trip.
      method.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        mockTripFailedForSite:(nonnull CSSite *)site
                        error:(nonnull NSError *)error;

    Swift

    optional func session(_ session: Any!, mockTripFailedFor site: CSSite!, error: Any!)
  •   If a delegate is set and the method is implemented you will get regular heartbeats when location are sent up to the server.
      method.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        mockTripSentLocationForSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, mockTripSentLocationFor site: CSSite!)
  •   If a delegate is set and the method is implemented you will get a callback when the mock trip is successfully cancelled.
      method.
    

    Declaration

    Objective-C

    - (void)session:(nonnull CSUserSession *)session
        mockTripCancelledForSite:(nonnull CSSite *)site;

    Swift

    optional func session(_ session: Any!, mockTripCancelledFor site: CSSite!)