System & Diagnostics

Pre-requisite: The SDK has to be configured. ping and appStoreVersion need no signed-in user; speedTest does.

Three utility calls on Factory.systemService for an app’s own health checks. (The fourth call on this service, eventM3U8, is documented with Event Playback.)


Ping

To check that the InstaVision API is reachable, The following method can be used. It does not validate the user session — a ping can succeed while the stored access token has expired.

Factory.systemService.ping() -> IVPublisher<Void>

Speed Test

To measure download bandwidth, The following method can be used. It downloads a fixed payload; time the call yourself and divide the byte count by the elapsed time. It consumes real bandwidth, so run it on demand rather than on a schedule.

Factory.systemService.speedTest() -> IVPublisher<Data>

App Store Version

To look up the version of the app currently published on the App Store — for an “update available” prompt — The following method can be used:

  • queryItems (required): Must contain a .bundleId item identifying the app.
Factory.systemService.appStoreVersion(queryItems: [QueryItem]) -> IVPublisher<AppStoreVersionResultModel>

AppStoreVersionResultModel.results is a list of AppStoreVersionModel, each with a version string. Compare it against CFBundleShortVersionString.


Log upload

SDKService (logUploadUrl(fileName:), uploadLogs(data:fileName:model:)) exists in the framework but the service, its contract, its LogUploadResponseModel and the Factory.sdkService accessor are all internal, so an app cannot reach it today.