Manage Spaces
Pre-requisite: The user has to be signed in to perform the following operations.
Create Space
To create a space, you need to provide the following details:
request(required): The space information.
Factory.spaceService.createSpace(request: CreateSpaceRequest) -> IVPublisher<Void>
Get Spaces
To get the list of spaces, the following method can be called.
Factory.spaceService.spaces() -> IVPublisher<[SpaceModel]>
Update Space
To update the space information, the following method can be called.
spaceId(required): The id of the space.request(required): The updated space information.
Factory.spaceService.updateSpace(spaceId: String, request: CreateSpaceRequest) -> IVPublisher<Void>
Get Space Settings
To fetch the settings for a space, The following method can be used:
spaceId(required): The id of the space.
Factory.spaceService.getSpaceSettings(
spaceId: String
) -> IVPublisher<SpaceSettings>
Update Space Settings
To update the settings of a space, The following method can be used:
spaceId(required): The id of the space.request(required): Contains the updated space settings.
Factory.spaceService.updateSpaceSettings(
spaceId: String,
request: SpaceSettings
) -> IVPublisher<Void>
Leave Space
To leave a space, The following method can be used:
spaceId(required): The id of the space.
Factory.spaceService.leaveSpace(
spaceId: String
) -> IVPublisher<Void>
Get the Connection Credentials
To get the credentials used to establish a streaming connection with a camera in the space, The following method can be used.
spaceId(required): The id of the space.queryItems(required): The query parameters used to scope the credentials.
Factory.spaceService.connectionCredential(spaceId: String, queryItems: [QueryItem]) -> IVPublisher<ConnectionCred>
Get Everything for the Home Screen
Available only in partner builds of the SDK compiled with the
IVSDK_PARTNERflag. In the standard build the method is not part ofSpaceServiceContractand the call does not compile.
To load a space and what an app’s home screen needs about it in one round trip, The following method can be used. The response bundles the space, its subscriptions, subscriptions in their grace period, its devices, the latest firmware for each, event download tokens, security profiles and lullaby settings.
queryItems(optional): Aresourcesitem naming the sections to include.
Factory.spaceService.getSpaceAggregateData(queryItems: [QueryItem]?) -> IVPublisher<SpaceAggregateResponseModel>
SpaceAggregateResponseModel.data is a list of AggregateDataModel, one per space, each holding space, subscriptions, overdueSubscriptions, devices, firmwares, b2DownloadTokens, securityProfiles and lullabySettings. Every section is wrapped in SpaceAggregateDataModel<T> with its own status, statusCode and error, so one section can fail while the rest load; successfulResources, failedResources and partialFailure summarise which did.