Overview (iOS)¶
To use the Surfmeter Mobile Quality SDK on iOS, you generally need to perform two main steps:
- Register your client: This is a one-time setup process using your license key. It is required, since a test cannot be built until the server has confirmed the device.
- Instantiate and run a Quality Test: Choose the appropriate test type for your needs (AVPlayer or Web), configure it using its builder, and then start the test.
Both test types follow the same shape. You create a builder, set the options you need, attach a result listener, call build() and then start(). The test runs on the main thread, reports its progress through the listener, and delivers one final callback with either the measurement report or an error message. Everything is computed on the device, and the result is uploaded to your Surfmeter server as well, which needs nothing beyond having registered.
This section provides links to detailed explanations for each of these steps and test types.
Demo App¶
A demo app is provided with the SDK to illustrate its usage. You can find it by unzipping the QualitySDKExample.zip file. It is a SwiftUI app with three tabs:
- a video test tab, which runs an
AVPlayerQualityTestagainst a configurable stream URL - a web test tab, which runs a
WebQualityTestagainst a configurable page URL - a results tab, which lists every finished report and shows it as a quality gauge with the individual values, with the raw JSON one button away
The demo app reads the server endpoint and registration key from its build settings rather than from source, so that neither ends up in a build by accident. Copy Config/Local.xcconfig.example to Config/Local.xcconfig and put your values in there. Without them the app cannot register, and no test will run.
You can take the views from the demo into your existing application, or start a new app from it. Ensure that you have correctly set up the SDK as outlined in the installation instructions. See the README in the archive for how to swap the local package reference for the real SDK.
If you need more information, refer to the specific pages for more detailed information on each aspect:
Every class and method is also described in the API documentation that ships with the SDK.