MovementSdkManager | Documentation

MovementSdkManager

Class for configuring the Movement SDK in your app to get background location updates with context.

@objc(FSQMovementSdkManager)
class MovementSdkManager

Instance Properties

var currentJourney: Journey? Access data about a currently running Journey. This method will return nil when there is not current journey running.

var delegate: MovementSdkManagerDelegate? A delegate object that you control that receives updates when new locations are visited. You may change this at any time. If you set this to nil, the location manager will continue running, but you will not receive updates until you set it again.

let feedbackProvider: FeedbackProvider Use to provide feedback on visits for Foursquare to use to improve.

var hasHomeOrWork: Bool It can take several days to make a high confidence estimate of the user’s home and work locations.

var homeLocations: [NSValue] Returns home locations.

var installId: String? Returns a unique identifier that gets generated the first time this sdk runs on a specific device.

var isDebugLogsEnabled: Bool Saves detailed logs of activity for debugging purposes.

var isEnabled: Bool Is Movement SDK currently enabled.

var isLiveDebugEnabled: Bool Enable to see live debug events in the developer console while in development.

var lastKnownUserState: LastKnownUserState? The most recently retrieved user state. The value of this property is nil if no user state has ever been retrieved.

var movementSDKVersionString: String Version string for the Movement SDK.

var shouldDisableAdIdentitySharing: Bool Disable sharing of advertising identity data.

var userInfo: UserInfo For applications utilizing the server-to-server method for visit notifications, you can use this to pass through your own identifier to the notification endpoint call.

let visitTester: VisitTester Helper for testing visit.

var workLocations: [NSValue] Returns work locations.

Instance Methods

func cancelJourney(completion: ((Error?) -> Void)?) Cancel the current journey, stop all journey updates and set currentJourney to nil. If successful, this method will cause a final journey update with a status of cancelled.

func checkinJourney(completion: ((Error?) -> Void)?) Checkin at the current journey’s destination, stop all journey updates and set currentJourney to nil. If successful, this method will cause a final journey update with a status of completed.

func clearAllData(completion: (() -> Void)?) Remove all visit history, including resetting the home/work model.

func completeJourney(completion: ((Error?) -> Void)?) Complete the current journey, stop all journey updates and set currentJourney to nil. If successful, this method will cause a final journey update with a status of completed.

func configure(withConsumerKey: String, secret: String, oauthToken: String?, delegate: MovementSdkManagerDelegate?, completion: ((Bool, Error?) -> Void)?) Configure the Movement SDK with your consumer key and secret, and add a delegate for subscribing to location updates. This method is safe to call more than once, but consumer key and secret must remain the same.

func debugLogs() -> [DebugLog] Gets an array of recent Debug logs.

func debugLogs(completion: ([DebugLog]) -> Void) Gets an array of recent DebugLog items and delivers them to the completion handler.

func deleteDebugLogs() Deletes debug logs from disk.

func getCurrentLocation(completion: (CurrentLocation?, Error?) -> Void) Gets the current location of the user.

func presentDebugViewController(parentViewController: UIViewController) Initializes a debug mode view controller for viewing Movement SDK logs and presents it.

func setUserInfo(UserInfo?, persisted: Bool) For applications utilizing the server-to-server method for visit notifications, you can use this to pass through your own identifier to the notification endpoint call.

func start() Call this after configuring the SDK to start the SDK and begin receiving location updates.

func startJourney(destinationId: String, destinationType: Journey.DestinationType, metadata: [String : String]?, completion: ((Error?) -> Void)?) Begin a journey to a Foursquare venue or geofence by passing the destination id as well any metadata you’d like to accompany the start request. Once a journey has been started you will automatically receive updates via the MovementSdkManagerDelegate/movementManager(_:handle:) delegate method. Updates will occur roughly once per minute while the journey is active.

func stop() Stop receiving location updates, until you call start() again.

func updateConfiguration(withConsumerKey: String, secret: String) Update your configuration to use a new consumer key and secret.

Type Properties

static let errorDomain: String Error returned as the domain to NSError from Movement SDK.

static let shared: MovementSdkManager A global shared instance of the Movement SDK that should be used for configuring your consumer key and delegate.

Enumerations

enum ErrorCode Error returned as the code to NSError from Movement SDK.

Relationships

Inherits From

Conforms To