CLASS
IPSDataManager
public class IPSDataManager: NSObject
This class represents the data management service that can be used to prepare all the information required to perform positioning ahead of time to ensure frictionless user experience.
As an application developer you do not have to use this service as IPSPositioning service will anyway download all the necessary data when start positioning is requested. If the business logic of your application allows you to identify the building in which a positioning session will take place ahead of time you can give the SDK a head start so that when the IPSPositioning.startPositioning() is called we can start immediately, even without an Internet connection.
- Since: 4.0.0
Methods
getDataStatus(for:completion:)
@objc public static func getDataStatus(
for buildingId: String,
completion: @escaping (IPSDataStatus) -> Void
)
Provides the status of the data required for positioning in the specific building. - Since: 4.0.0
prepareData(for:)
@objc public static func prepareData(for buildingId: String)
Start preparing the data required for positioning in the building. - Since: 4.0.0
cancelDataPreparation(for:)
@objc public static func cancelDataPreparation(for buildingId: String)
Cancel preparing the data required for positioning in the building. The data preparation for all the floors in the building will be cancelled. - Since: 4.0.0
cancelAllBuildingsDataPreparation()
@objc public static func cancelAllBuildingsDataPreparation()
Cancel all requested data preparations. - Since: 4.0.0
clearData(for:)
@objc public static func clearData(for buildingId: String)
Clear the data prepared for positioning in the building. Will cancel preparing to load data for buildingId if it exists - Since: 4.0.0
clearAllCaches(onSuccess:onError:)
@objc public static func clearAllCaches(onSuccess: @escaping () -> Void, onError: @escaping (IPSError) -> Void)
A method to clear the SDK caches: maps, buildings, logs, images. All data upload preparations will be canceled if they exist - Since: 4.0.0
- Parameters:
- onSuccess: Completion block
- onError: Failed response block with the error description
Parameters
| Name | Description |
|---|---|
| onSuccess | Completion block |
| onError | Failed response block with the error description |
clearCacheByType(_:onSuccess:onError:)
public static func clearCacheByType(_ dataTypes: [IPSDataCacheType], onSuccess: @escaping () -> Void, onError: @escaping (IPSError) -> Void)
Clear specific categories of the SDK caches. Multiple categories can be cleared in a single call
(see IPSDataCacheType).
-
Since: 9.9.0
-
Parameters:
- dataTypes: the cache categories to clear
- onSuccess: Completion block
- onError: Failed response block with the error description
Parameters
| Name | Description |
|---|---|
| dataTypes | the cache categories to clear |
| onSuccess | Completion block |
| onError | Failed response block with the error description |
clearCacheForBuildingByType(_:dataTypes:onSuccess:onError:)
public static func clearCacheForBuildingByType(
_ buildingId: String,
dataTypes: [IPSDataCacheType],
onSuccess: @escaping () -> Void,
onError: @escaping (IPSError) -> Void
)
Clear specific categories of the SDK caches for a single building. Multiple categories can be
cleared in a single call (see IPSDataCacheType).
-
Since: 9.9.0
-
Parameters:
- buildingId: the building to clear the cache for
- dataTypes: the cache categories to clear
- onSuccess: Completion block
- onError: Failed response block with the error description
Parameters
| Name | Description |
|---|---|
| buildingId | the building to clear the cache for |
| dataTypes | the cache categories to clear |
| onSuccess | Completion block |
| onError | Failed response block with the error description |
addDataStatusObserver(_:)
@objc public static func addDataStatusObserver(_ observer: IPSDataStatusObserver)
This method is used to add an observer to receive data status updates and relevant errors.
-
Since: 4.0.0
-
Parameters:
- observer: an object implementing
IPSDataStatusObserverprotocol. Only weak reference to the observer will be stored.
Parameters
| Name | Description |
|---|---|
| observer | an object implementing IPSDataStatusObserver protocol. Only weak reference to the observer will be stored. |
removeDataStatusObserver(_:)
@objc public static func removeDataStatusObserver(_ observer: IPSDataStatusObserver)
This method is used to remove an observer and stop receiving related updates.
-
Since: 4.0.0
-
Parameters:
- observer: an object implementing
IPSDataStatusObserverprotocol
Parameters
| Name | Description |
|---|---|
| observer | an object implementing IPSDataStatusObserver protocol |