CSTracker Class Reference

Inherits from NSObject
Declared in CSTracker.h

Overview

The CSTracker object is for integrating on to the Mobile application to enable location tracking for user device. Tracking will be activated if there is atleast one tracked CSUserStoreRegion. The tracked store regions are persisted across relaunches.

Note: This requires the CSMobileSession to be in CSSessionStateValid state.

Other Methods

  trackedStoreRegions

This returns all the currently tracked CSUserStoreRegion(s).

@property (nonatomic, readonly) NSSet *trackedStoreRegions

Discussion

This returns all the currently tracked CSUserStoreRegion(s).

Declared In

CSTracker.h

  isTracking

true if this tracker is currently tracking the user device. This will return NO if any of the following conditionare is true : No valid CSSession Background App Refresh disabled Location services disabled or Authorization status != kCLAuthorizationStatusAuthorizedAlways APNS notifications disabled No trackedStoreRegions defined

@property (nonatomic, readonly) BOOL isTracking

Return Value

true if this tracker is currently tracking the user device. This will return NO if any of the following conditionare is true : No valid CSSession Background App Refresh disabled Location services disabled or Authorization status != kCLAuthorizationStatusAuthorizedAlways APNS notifications disabled No trackedStoreRegions defined

Declared In

CSTracker.h

  delegate

The delegate object which will be notified if there the user is near a tracked store.

@property (nonatomic, assign) id<CSTrackerDelegate> delegate

Return Value

The delegate object which will be notified if there the user is near a tracked store.

Declared In

CSTracker.h

+ sharedTracker

Clients should not be initializing multiple instances of the CSTracker. There should be only one CSTracker in the application, and this method should be used to get that instance where-ever required.

+ (instancetype)sharedTracker

Discussion

Clients should not be initializing multiple instances of the CSTracker. There should be only one CSTracker in the application, and this method should be used to get that instance where-ever required.

Declared In

CSTracker.h

– startTrackingUserStoreRegion:error:

Adds the given storeRegion as one of the stores to be tracked for the user. Call this method when the client thinks its appropriate to start tracking the user eg. Order is ready to be picked up at the store defined by the storeRegion. This information is persisted across relaunch.

- (BOOL)startTrackingUserStoreRegion:(CSUserStoreRegion *)storeRegion error:(NSError **)error

Discussion

Adds the given storeRegion as one of the stores to be tracked for the user. Call this method when the client thinks its appropriate to start tracking the user eg. Order is ready to be picked up at the store defined by the storeRegion. This information is persisted across relaunch.

Will return NO if any of the following condition is true No valid CSSession Background App Refresh disabled Location services disabled or Authorization status != kCLAuthorizationStatusAuthorizedAlways APNS notifications disabled

error: The NSError indicates the failurer reason

Declared In

CSTracker.h

– stopTrackingUserStoreRegion:forTrackToken:

Removes the trackingToken from the given storeRegion.

- (void)stopTrackingUserStoreRegion:(CSUserStoreRegion *)storeRegion forTrackToken:(NSString *)trackToken

Discussion

Removes the trackingToken from the given storeRegion.

Declared In

CSTracker.h

– stopTrackingUserStoreRegion:

Removes the given storeRegion from the stores being tracked for this user. Call this method when there are no more orders to be picked up at the given storeRegion. Note that calling this would stop tracking the given storeRegion across all devices for the user.

- (void)stopTrackingUserStoreRegion:(CSUserStoreRegion *)storeRegion

Discussion

Removes the given storeRegion from the stores being tracked for this user. Call this method when there are no more orders to be picked up at the given storeRegion. Note that calling this would stop tracking the given storeRegion across all devices for the user.

Declared In

CSTracker.h

– stopAllStoreTracking

Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

- (void)stopAllStoreTracking

Discussion

This method would stop all tracking for this user across all devices.

Note: Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

Declared In

CSTracker.h

– cancelTrackingUserStoreRegion:forTrackToken:

Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

- (void)cancelTrackingUserStoreRegion:(CSUserStoreRegion *)storeRegion forTrackToken:(NSString *)trackToken

Discussion

Cancel tracking the trackToken for the given store. Call this when the particular order is cancelled.

Note: Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

Declared In

CSTracker.h

– cancelTrackingUserStoreRegion:

Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

- (void)cancelTrackingUserStoreRegion:(CSUserStoreRegion *)storeRegion

Discussion

Cancels all trackTokens for the given stores. Call this if the user cancelled all orders at the store

Note: Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

Declared In

CSTracker.h

– cancelAllStoreTracking

Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

- (void)cancelAllStoreTracking

Discussion

This method would cancels all tracking for all stores for the given user.

Note: Do not call this when the user logs out, the SDK will do the appropriate thing when the user logs out.

Declared In

CSTracker.h

– updateTrackedStoresFromServer

This method would update the CurbsideSDK with the current state of tracked stores from the server.

- (void)updateTrackedStoresFromServer

Discussion

This method would update the CurbsideSDK with the current state of tracked stores from the server.

Declared In

CSTracker.h

DisableRegions Methods

+ disableStoreRegionCreation

Call this method on the CSTracker class before calling the shared tracker. This will disable the creation of store regions for this tracker instance.

+ (void)disableStoreRegionCreation

Discussion

Call this method on the CSTracker class before calling the shared tracker. This will disable the creation of store regions for this tracker instance.

Declared In

CSTracker+DisableRegions.h

– didEnterRegion:

Call this method when a region is entered.

- (void)didEnterRegion:(CLRegion *)region

Discussion

Call this method when a region is entered.

Declared In

CSTracker+DisableRegions.h

– didExitRegion:

Call this method when a region is exited.

- (void)didExitRegion:(CLRegion *)region

Discussion

Call this method when a region is exited.

Declared In

CSTracker+DisableRegions.h