CLASS
IPSContent
public class IPSContent: NSObject
This class provides access to map content.
Content includes IPSLocationTags and IPSRegions.
The content may vary depending on the selected space (see IPSCore.getSelectedSpaceId()).
@since 2.10.0
Methods
search(buildingId:searchTerm:pageSize:onSuccess:onError:)
@objc public static func search(buildingId: String?,
searchTerm: String,
pageSize: Int = 20,
onSuccess: @escaping (_ results: [IPSContentItem], _ nextPage: IPSContentSearchPage?) -> Void,
onError: @escaping (IPSError) -> Void) -> IPSCancellable
A method for searching content with placements in a specific building. Content includes IPSLocationTags and IPSRegions.
The fetch is only possible if the IPSCore.ConnectionState is not IPSCore.ConnectionState.offline
and a login was performed.
The search will use current selected space, see IPSCore.getSelectedSpaceId() for reference.
-
Since: 2.12.0
-
Parameters:
- buildingId: The id of the building where the placements of searched items are located.
- searchTerm: The search term to look for in a content's name or description. Key insensitive.
- pageSize: Max number of items to return.
- onSuccess: The closure will be called in case of success, with parameters: list of
IPSContentItemitems and optionalIPSContentSearchPageobject to fetch more results. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request.
fetch(searchPage:onSuccess:onError:)
@objc public static func fetch(searchPage: IPSContentSearchPage,
onSuccess: @escaping (_ results: [IPSContentItem], _ nextPage: IPSContentSearchPage?) -> Void,
onError: @escaping (IPSError) -> Void) -> IPSCancellable
A method for fetching additional results of content search using the next page returned from IPSContent.search(buildingId:searchTerm:pageSize:onSuccess:onError:).
The fetch is only possible if the IPSCore.ConnectionState is not IPSCore.ConnectionState.offline
and a login was performed.
-
Since: 2.12.0
-
Parameters:
- searchPage:
IPSContentSearchPagereceived in response of successful search request. - onSuccess: The closure will be called in case of success, with parameters: list of
IPSContentItemitems and optionalIPSContentSearchPageobject to fetch more results. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request.
addRegionsObserver(_:for:)
@objc public static func addRegionsObserver(_ observer: IPSRegionsObserver, for buildingId: String)
This observer is used to receive updates regarding regions in a building.
When an observer is set the IPSRegionsObserver.onRegionsAdded(_:buildingId:)
will be called initially for all the regions currently in this building.
-
Since: 2.12.0
-
Parameters:
- observer: an object implementing
IPSRegionsObserverprotocol - buildingId: the id of building for which the regions should be reported
removeRegionsObserver(_:for:)
@objc public static func removeRegionsObserver(_ observer: IPSRegionsObserver, for buildingId: String)
This method is used to remove observer and stop receiving updates regarding regions in a building.
-
Since: 2.12.0
-
Parameters:
- observer: an object implementing
IPSRegionsObserverprotocol - buildingId: the id of building for which the regions should not be reported anymore
getLocationTagsById(ids:buildingId:onSuccess:onError:)
@objc public static func getLocationTagsById(
ids: [String],
buildingId: String,
onSuccess: @escaping ([IPSLocationTag]) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
A method for fetching specific location tags by id.
The fetch is only possible if the IPSCore.ConnectionState is not IPSCore.ConnectionState.offline
and a login was performed. The fetch will use current selected space, see IPSCore.getSelectedSpaceId() for reference.
-
Since: 2.12.0
-
Parameters:
- ids: List of strings, ids of
IPSLocationTagobjects. - buildingId: Id of a
IPSBuildingobject where the specified location tags are located. - onSuccess: The closure will be called in case of success, with parameter: list of
IPSLocationTagitems, in case some of the requested location tags are not available the number of results may not be the same with the number of ids in the request. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request.
getRegionsById(ids:buildingId:onSuccess:onError:)
@objc public static func getRegionsById(ids: [String],
buildingId: String,
onSuccess: @escaping ([IPSRegion]) -> Void,
onError: @escaping (IPSError) -> Void) -> IPSCancellable
A method for fetching specific regions by id.
The fetch is only possible if the IPSCore.ConnectionState is not IPSCore.ConnectionState.offline
and a login was performed. The fetch will use current selected space, see IPSCore.getSelectedSpaceId() for reference.
-
Since: 3.0.0
-
Parameters:
- ids: List of strings, ids of
IPSRegionobjects. - buildingId: Id of a
IPSBuildingobject where the specified regions are located. - onSuccess: The closure will be called in case of success, with parameter: list of
IPSRegionitems, in case some of the requested regions are not available the number of results may not be the same with the number of ids in the request. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request.
getRegions(buildingId:onSuccess:onError:)
@objc public static func getRegions(
buildingId: String,
onSuccess: @escaping ([IPSRegion]) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
A method for fetching all regions in a building.
-
Since: 5.0.0
-
Parameters:
- buildingId: Id of a
IPSBuildingobject where the specified regions are located. - onSuccess: The closure will be called in case of success, with parameter: list of
IPSRegionitems, in case some of the requested regions are not available the number of results may not be the same with the number of ids in the request. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request.
snapToClosestRegion(coordinate:regions:)
public static func snapToClosestRegion(
coordinate: IPSCoordinateInBuilding,
regions: [IPSRegion]
) -> IPSSnapToRegionResult?
Snaps a given coordinate to the closest region from a list of regions.
- Parameters:
- coordinate: The input coordinate within the building for which the closest region will be found.
- regions: A list of regions to search from.
- Returns: An optional IPSClosetRegionFindingResult object containing details about the closest region, or nil if no region is found.
- Since: 8.3.0
Parameters
| Name | Description |
|---|---|
| coordinate | The input coordinate within the building for which the closest region will be found. |
| regions | A list of regions to search from. |
snapToClosestShape(coordinate:shapes:)
public static func snapToClosestShape(
coordinate: IPSCoordinate,
shapes: [IPSShape]
) -> IPSSnapToShapeResult?
Snaps a given coordinate to the closest shape from a list of shapes.
- Parameters:
- coordinate: The input coordinate for which the closest shape will be found.
- shapes: A list of shapes to search from.
- Returns: An optional IPSClosetShapeFindingResult object containing details about the closest shape, or nil if no shape is found.
- Since: 8.3.0
Parameters
| Name | Description |
|---|---|
| coordinate | The input coordinate for which the closest shape will be found. |
| shapes | A list of shapes to search from. |
getProductLocation(productId:buildingId:onSuccess:onError:)
public static func getProductLocation(
productId: String,
buildingId: String,
onSuccess: @escaping (IPSProductLocationSearchResult?) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
Fetches Product Location AI for a specified product within a building
- Parameters:
- productId: The identifier of the product for which location is requested
- buildingId: The identifier of the IPSBuilding object where the specified product is located.
- onSuccess: A closure that is called with the IPSProductLocationSearchResult object if the product location is successfully retrieved.
- onError: A closure that is called with an IPSError object if an error occurs while fetching the product location.
- Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request. - Since: 8.3.0
Parameters
| Name | Description |
|---|---|
| productId | The identifier of the product for which location is requested |
| buildingId | The identifier of the IPSBuilding object where the specified product is located. |
| onSuccess | A closure that is called with the IPSProductLocationSearchResult object if the product location is successfully retrieved. |
| onError | A closure that is called with an IPSError object if an error occurs while fetching the product location. |
getCategoryLocation(categoryId:buildingId:onSuccess:onError:)
public static func getCategoryLocation(
categoryId: String,
buildingId: String,
onSuccess: @escaping (IPSCategoryLocationSearchResult?) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
Fetches Category Location AI for a specified category within a building
- Parameters:
- categoryId: The identifier of the category for which location is requested
- buildingId: The identifier of the IPSBuilding object where the specified category is located.
- onSuccess: A closure that is called with the IPSCategoryLocationSearchResult object if the category location is successfully retrieved.
- onError: A closure that is called with an IPSError object if an error occurs while fetching the category location
- Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request. - Since: 8.3.0
Parameters
| Name | Description |
|---|---|
| categoryId | The identifier of the category for which location is requested |
| buildingId | The identifier of the IPSBuilding object where the specified category is located. |
| onSuccess | A closure that is called with the IPSCategoryLocationSearchResult object if the category location is successfully retrieved. |
| onError | A closure that is called with an IPSError object if an error occurs while fetching the category location |
getProductAndCategoriesLocation(productId:categoryIds:buildingId:onSuccess:onError:)
public static func getProductAndCategoriesLocation(
productId: String,
categoryIds: [String],
buildingId: String,
onSuccess: @escaping (IPSProductAndCategoriesLocationSearchResult?) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
Fetches Product Location AI and Categories Locations AI information for a specified product and its categories within a building
- Parameters:
- productId: The identifier of the product for which location is requested
- categoryIds: An array of identifiers of the categories for which locations is requested
- buildingId: The identifier of the IPSBuilding object where the specified product and categories are located.
- onSuccess: A closure that is called with the IPSProductAndCategoriesLocationSearchResult object if the product or categories locations is successfully retrieved.
- onError: A closure that is called with an IPSError object if an error occurs while fetching the product or categories locations.
- Returns:
IPSCancellableto cancel the request if necessary. Neither onSuccess not onError will be called for a cancelled request. - Since: 8.3.0
Parameters
| Name | Description |
|---|---|
| productId | The identifier of the product for which location is requested |
| categoryIds | An array of identifiers of the categories for which locations is requested |
| buildingId | The identifier of the IPSBuilding object where the specified product and categories are located. |
| onSuccess | A closure that is called with the IPSProductAndCategoriesLocationSearchResult object if the product or categories locations is successfully retrieved. |
| onError | A closure that is called with an IPSError object if an error occurs while fetching the product or categories locations. |
getAnalyticsRegions(buildingId:analyticsRegionType:onSuccess:onError:)
@objc public static func getAnalyticsRegions(
buildingId: String,
analyticsRegionType: IPSAnalyticsRegionType? = nil,
onSuccess: @escaping ([IPSAnalyticsRegion]) -> Void,
onError: @escaping (IPSError) -> Void
) -> IPSCancellable
A method for fetching analytics regions in a building, optionally filtered by type.
-
Since: 9.9.0
-
Parameters:
- buildingId: Id of a
IPSBuildingobject where the specified regions are located. - analyticsRegionType: Optional filter restricting the result to regions of the given type
(for example
IPSAnalyticsRegionType.categoryorIPSAnalyticsRegionType.aisle). Passnil(the default) to return all analytics regions in the building regardless of their type. - onSuccess: The closure will be called in case of success, with parameter:
list of
IPSAnalyticsRegionitems. The list may be empty if no regions match the requested type. -
onError: The closure will be called in case of error, with parameter:
IPSErrorwith the error description. -
Returns:
IPSCancellableto cancel the request if necessary. NeitheronSuccessnoronErrorwill be called for a cancelled request.
Parameters
| Name | Description |
|---|---|
| buildingId | Id of a IPSBuilding object where the specified regions are located. |
| analyticsRegionType | Optional filter restricting the result to regions of the given type (for example IPSAnalyticsRegionType.category or IPSAnalyticsRegionType.aisle). Pass nil (the default) to return all analytics regions in the building regardless of their type. |
| onSuccess | The closure will be called in case of success, with parameter: list of IPSAnalyticsRegion items. The list may be empty if no regions match the requested type. |
| onError | The closure will be called in case of error, with parameter: IPSError with the error description. |