iOS SDK¶
This document is for our SDK version 5.2.8 for iOS and tvOS. The sample code is written in Swift and is compatible with Xcode 16.4 or later
Debug¶
This section describes how to verify that the integration of Our SDK with your application has been performed correctly. Debugging the application requires an Xcode connected device with an access to Xcode's console log.
Enable debug messages¶
In order to print debug messages to the Xcode console log you need to instruct Our SDK instance to enable logging. To do so, set the property logLevel of the init method to .info.
let polyNet = try? PolyNet(manifestUrl: manifestUrl,
channelId: channelId,
apiKey: apiKey,
managesEncryptionKeys: true,
logLevel: .info)
...
Check the SDK version¶
To confirm which version of the SDK your app is running, print the framework version:
print(PolyNet.frameworkVersion)
The configuration¶
As explained in Our SDK's configuration section, the call to the SDK init method will return a PolyNet instance or PolyNetError. If a configuration error occurs due to an incorrect ApiKey, search the console log for:
Check your API Key. Detail: *{detail}*. If problem persists, contact support at support@system73.com..
If any other error occurs on init, search the console log for: The PolyNet SDK has failed to build. Detail: *{detail}*. If problem persists, contact support at support@system73.com., the detail will provide further information about the error.
For the complete list of error codes, see the error table in the SDK usage documentation.
The connection to our service¶
If everything is OK, you should see one of the following messages in the log some time after the object is instantiated:
- When connected to fetch content from CDN:
Connected successfully to the Tracker, with ID = (...). Will fetch from CDN - When connected to fetch content from a peer:
Connected successfully to the Tracker, with ID = (...). Will fetch from P2P parent ID = ...
The IDs in these messages show only the last 5 characters of the node ID and parent ID. To verify that the nodes are connected, examine the node ID, and the parent ID on the System73's Dashboard.
Tracker Issues¶
If the connection with Tracker cannot be opened due to a malformed apiKey search the console log for: Check your API Key. If problem persists, contact support at support@system73.com., you can handle this error in the polyNet:didFailWithError: delegate method with the codes: -600, -601.
If an issue with the Tracker Handshake occurs, search the console log for: The PolyNet SDK is not compatible with the Tracker. Tracker code: *{handshake_rejected_code}*. This may happen in transitions to newer versions. If problem persists, contact support at support@system73.com., you can handle this error in the polyNet:didFailWithError: delegate method with its code: -701.
If connection to Tracker Metrics Endpoint fails search the console log for:Error communicating with PolyNet metrics server endpoint. Detail: *{detail}*. If problem persists, contact support at support@system73.com., you can handle this error in the polyNet:didFailWithError: delegate method with its code: -703.
If the SDK cannot get the local URL of the content manifest (for example, because the manifest is not reachable or is not supported), search the log for: Error while getting the local Manifest URL. The original is returned instead. The PolyNet is deactivated.. The SDK reports this as an internal error, which you can handle in the polyNet:didFailWithError: delegate method with its code: -700. This code is used for any internal SDK error, and the text above is the detail of this one.
Other Tracker errors¶
- If the API key has been revoked, search the console log for:
The Api Key is revoked from Tracker. Please, contact support at support@system73.com., code: -704. - If the Tracker rejects the connection, search the console log for:
PolyNet connection rejected. Detail: *{detail}*. If problem persists, contact support at support@system73.com., code: -705. - If the content steering token is invalid or revoked, search the console log for:
Invalid or revoked CS token. If problem persists, contact support at support@system73.com., code: -706.
Content requests¶
Warning
It is VERY IMPORTANT to verify that the video player is requesting the content from the overlay, and not directly from the Internet or CDN.
To make sure the service works properly, the following messages need to appear in the console's log.
Content request URL = ...
If you can't find any of those types of messages in the log, it means that the player is not using our service's overlay to download content.
P2P¶
To verify that peers are able to connect to each other, search the console logs for the messages that show a connection to a parent and the disconnections from peers:
Connected to P2P parent with ID = ...
Disconnected from P2P parent with ID = ...
Disconnected from P2P child with ID = ...
The SDK logs when a device connects to its parent. To see that a device has a child, check the node ID and the parent ID on the System73's Dashboard.
Reconnections¶
Tracker Connection Related errors will yield: Error communicating with Tracker. Detail: *{detail}*. If problem persists, contact support at support@system73.com., you can handle this error in the polyNet:didFailWithError: delegate method with its code: -702.
If the SDK is commanded to connect to a different parent by the Tracker, search the console log for one of the following messages:
- When reconnecting to fetch content from CDN:
Node is moving, ID = (...). Will fetch from CDN - When reconnecting to fetch content from a peer:
Node is moving, ID = (...). Will fetch from P2P parent ID = ...
You can verify that the nodes are connected by looking for the node ID, and the parent ID, on the System73 Dashboard.
Build and launch issues¶
Build error: Unable to find module dependency: 'SwiftProtobuf'¶
This error occurred with version 5.2.7. Update to version 5.2.8 or later. You do not need to add swift-protobuf to your app.
The app crashes on launch: Library not loaded: @rpath/WebRTC.framework/WebRTC¶
WebRTC.framework is not embedded in your app. If you use Swift Package Manager, update to version 5.2.7 or later, which adds WebRTC automatically. Otherwise, make sure the WebRTC.framework for your platform (iOS or tvOS) is added to your app target and set to Embed & Sign.
Console message: Class ... is implemented in both ...¶
SwiftProtobuf is compiled into the SDK. If your app also links its own copy of SwiftProtobuf, the console can print messages such as Class _TtC13SwiftProtobuf... is implemented in both .... In integrator testing these were console warnings only and did not cause crashes. If you see crashes or unexpected behavior, contact support at support@system73.com with the full console output.
Example of the whole process¶
The following is an example of a debugging session where 2 devices are connected, and the operation runs successfully:
-
You need an exclusive channel for debugging, which is not used by anyone else. Make sure that no other device is connected to the channel. You can verify that on the System73 Dashboard.
-
Connect the first device to the channel. The device should be playing video. Check that its node ID shows up on the System73 Dashboard, connected to the CDN. Look for the following messages in the console's log:
Connected successfully to the Tracker, with ID = (...). Will fetch from CDN
Content request URL = ...
- Connect a second device. The device should start playing video within a few seconds. It should become a child node of the first device. Confirm that its node ID shows up on the System73 Dashboard, and that it is connected to the first device. Look for the following messages in the child's console log:
Connected successfully to the Tracker, with ID = (...). Will fetch from P2P parent ID = ...
Connected to P2P parent with ID = (...)
Content request URL = ...
The first device (the parent) does not log a message when the child connects. Check on the System73 Dashboard that the second node is connected to the first one.
This section was last updated 2026-11-25