SPSmartSDK

Objective-C

@interface SPSmartSDK : NSObject

Swift

class SPSmartSDK : NSObject

SPSmartSDK

Singleton class that is used to initialize the Steerpath Smart SDK. It’s highly recommended that you start the SDK inside your AppDelegate.

If you have an offline data bundle ‘sff’ file. You can use it by inserting the filename into your Info.plist with the keyword ‘SP_OFFLINE_DATA’. The data will be automatically read once the app starts.

Offline data Info.plist example:

SP_OFFLINE_DATA my_offline_data.sff

Object Lifecycle

  • Declaration

    Objective-C

    + (nonnull instancetype)getInstance;

    Swift

    class func getInstance() -> Self

    Return Value

    Singleton instance of SPSmartSDK

  • Unavailable

    call getInstance instead

    unavailable methods, do not use these

    Declaration

    Objective-C

    - (nonnull instancetype)init;

Meta data

  • Returns the versions of the smart SDK and mapbox

    The key containing smart SDK version is smartSDKVersion, and mapboxSDKVersion for mapbox

    Declaration

    Objective-C

    + (nonnull NSDictionary *)getVersions;

    Swift

    class func getVersions() -> [AnyHashable : Any]

    Return Value

    A dictionary of this sdk version, and mapbox version

Start

  • Starts the SDK with a specific API key

    Changes the API key to use for authentication to the Steerpath Platform.

    Need API access? Contact support@steerpath.com

    Declaration

    Objective-C

    - (void)start:(nonnull NSString *)apiKey;

    Swift

    func start(_ apiKey: String)

    Parameters

    apiKey

    used for authentication

  • Starts the SDK with a specific API Key and a custom config file path. Usually developers don’t need this variant of start()-method. Just use the default one.

    Need API access? Contact support@steerpath.com

    Declaration

    Objective-C

    - (void)start:(nonnull NSString *)apiKey
           config:(nonnull NSString *)configFilePath;

    Swift

    func start(_ apiKey: String, config configFilePath: String)

    Parameters

    apiKey

    used for authentication

    configFilePath

    the local file path to the config JSON file

Configurations

  • Deprecated

    use loginToLive instead

    Sets configurations for Steerpath Live.

    Declaration

    Objective-C

    - (void)setLiveConfiguration:(nonnull NSDictionary *)configuration;

    Swift

    func setLiveConfiguration(_ configuration: [AnyHashable : Any])

    Parameters

    configuration

    for using Steerpath Live

  • Sets configurations for Steerpath Live. Set transmit config to share location to SP Live and set receive config to receive live updates to map. Leave transmit config out if you don’t want to share location, or leave receive config out if you don’t want to receive map updates.

    Sample JSON: {“receive”:{“showsThisDevice”:true,“groups”:[“Employees”,“Bosses”]},“transmit”:{“id”:“test-id”,“password”:“1234”,“title”:“Developer”,“groups”:[“Employees”,“Bosses”],“geofences”:{“neutral”:[“Neutral-Area”],“allowed”:[“Allowed-Area”],“forbidden”:[“Forbidden-Area”]}}}

    Declaration

    Objective-C

    - (void)loginToLive:(nonnull NSDictionary *)configuration;

    Swift

    func login(toLive configuration: [AnyHashable : Any])

    Parameters

    configuration

    for using Steerpath Live

  • Logout from live service. Stops location sharing and map updates. Call loginToLive to start again.

    Declaration

    Objective-C

    - (void)logoutFromLive;

    Swift

    func logoutFromLive()

Localisation

  • Sets the default language for the search. In future release, this will also change the language of the map. Does not change the UI language.

    Declaration

    Objective-C

    - (void)setLanguage:(nonnull NSString *)languageCode;

    Swift

    func setLanguage(_ languageCode: String)

    Parameters

    languageCode

    ISO 639-1 standard language code, followed by optional ISO-3166 country code. For example “en”, “en-GB” or “en_GB”. The country code part will be ignored. Supported languages are defined in config.json. If unsupported language is given, nothing happens. Null value will reset to the default.