Integrating the PolyNet™ SDK
This document is for PolyNetSDK version 5 for iOS and tvOS.
The PolyNetSDK is delivered as a binary xcframework built with Swift Library Evolution support.
iOS 9.0 or later, tvOS 9.0 or later.
Latest Xcode version.
A reference integration sample application can be obtained from
https://github.com/System73/polynet-ios-sample-app. Once you clone the project, make a checkout to get the version 5 of the integration sample
git checkout PolyNetSDK-version-5.
To build and run the samples, follow the instructions of the README.md in the project directory.
Adding the SDK to your project
Information Property List File (Info.plist)
Arbitrary HTTP Loads
By default, the application will prevent non secure HTTP requests. Open the
Info.plist as a source code, add the following code to allow non-secure HTTP requests.
Instead of modifying the source code directly, you can select the Info tab of your project's target and add the tag
App Transport Security Settings. Inside the App Transport tag, add the tag
Allow Arbitrary Loads: YES.
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Embed Swift Standard Libraries [Only in pure ObjectiveC projects]
Select the Build Settings tab of your project's target and go to Build section. Set Always Embed Swift Standard Libraries to YES.
To integrate the PolyNetSDK.xcframework, the project will need the following frameworks:
To integrate PolyNet into your Xcode project using CocoaPods, specify in your Podfile the pod
PolyNetSDK. Note that
PolyNetSDK is a framework and you must use the
use_frameworks! flag. The pod will download and build the PolyNetSDK and the required dependencies.
A sample Podfile for iOS and tvOS:
use_frameworks! target 'YourApp' do pod 'PolyNetSDK', '~> 5.0' end
Note: It is recommended to use the pattern '~> 5.0' to match the latest major version 5.
To integrate PolyNet into your Xcode project using Carthage, specify it in your Cartfile together with the apple/swift-protobuf and daltoniam/Starscream, which are dependencies of the PolyNetSDK.
A sample Cartfile for iOS and tvOS:
binary "https://artifacts.s73cloud.com/repository/raw-s73-releases/s73-polynet-plat/polynet-apple-sdk/PolynetSDK.json" ~> 5.0 github "apple/swift-protobuf" ~> 1.0 github "daltoniam/Starscream" ~> 3.0
Note: It is recommended to use the operator ~> to match the latest major compatible version in PolyNetSDK and its dependencies.
Note: It is recommended to use the --use-xcframeworks parameter when using Carthage update.