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:
-
Declaration
Objective-C
+ (nonnull instancetype)getInstance;Swift
class func getInstance() -> SelfReturn Value
Singleton instance of SPSmartSDK
-
Unavailable
call getInstance instead
unavailable methods, do not use these
Declaration
Objective-C
- (nonnull instancetype)init;
-
Returns the versions of the smart SDK and mapbox
The key containing smart SDK version is
smartSDKVersion, andmapboxSDKVersionfor mapboxDeclaration
Objective-C
+ (nonnull NSDictionary *)getVersions;Swift
class func getVersions() -> [AnyHashable : Any]Return Value
A dictionary of this sdk version, and mapbox version
-
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
apiKeyused 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
apiKeyused for authentication
configFilePaththe local file path to the config JSON file
-
Deprecated
use loginToLive instead
Sets configurations for Steerpath Live.
Declaration
Objective-C
- (void)setLiveConfiguration:(nonnull NSDictionary *)configuration;Swift
func setLiveConfiguration(_ configuration: [AnyHashable : Any])Parameters
configurationfor 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
configurationfor 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()
-
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
languageCodeISO 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.
SPSmartSDK Class Reference