THEOPlayer 🤝 Conviva
The THEOplayer-Connector-Conviva-VerizonMedia for iOS provides an integration between the THEOplayerSDK and ConvivaSDK. It connects to the Conviva backend and reports events fired from THEOplayer instances (including VerizonMedia ad events).
For example xcode projects with this connector see Conviva-VerizonMedia-Examples.
Installation
Swift Package Manager
- In Xcode, install the Conviva libraries by navigating to File > Add Packages
- In the prompt that appears, select the iOS-Connector GitHub repository:
https://github.com/THEOplayer/iOS-Connector
- Select the version you want to use.
- Choose the Connector libraries you want to include in your app.
Because the VerizonMedia feature requires a custom build of the THEOplayerSDK perform the following steps:
- Clone this repository to your computer.
- Use a local override of the
theoplayer-sdk-ios
package by selecting the folder../../Helpers/TheoSPM/theoplayer-sdk-ios
in Finder and dragging it into the Project navigator of your Xcode project. - Place your custom THEOplayerSDK.xcframework at
../../Helpers/TheoSPM/theoplayer-sdk-ios/THEOplayerSDK.xcframework
. (It is also possible to place your xcframework somewhere else. In that case make sure to update the Package.swift manifest inside the your local override so that it points to your custom THEOplayer build) - If Xcode complains about a missing xcframework
- Choose
File
>Packages
>Reset Package Caches
from the menu bar. - If it is still not working, make sure to remove any
THEOplayerSDK.xcframework
inclusions that you manually installed before installing this THEOplayer-Connector-Conviva package.
- Choose
Cocoapods
- Create a Podfile if you don't already have one. From the root of your project directory, run the following command:
pod init
- To your Podfile, add the Conviva connector pods that you want to use in your app:
pod 'THEOplayer-Connector-Conviva'
- Install the pods using
pod install
, then open your.xcworkspace
file to see the project in Xcode.
Because the VerizonMedia feature requires a custom build of the THEOplayerSDK perform the following steps:
- Clone this repository to your computer.
- Use a local override of the
THEOplayerSDK-basic
pod by adding the following line to your projects Podfile:pod 'THEOplayerSDK-basic', :path => 'iOS-Connector/Helpers/TheoPod'
and make sure the path points to the TheoPod folder.
Usage
Import the THEOplayerConnectorConviva
module
import THEOplayerConnectorConviva
Create a ConvivaConfiguration
that contains the info on how to connect to your conviva endpoint:
let configuration = ConvivaConfiguration(
customerKey: "put your customer key here",
gatewayURL: " put your gateway URL here ",
logLevel: .LOGLEVEL_FUNC
)
Create a ConvivaConnectorVerizonMedia
that uses this configuration
and your THEOplayer
instance:
import THEOplayerConnectorConvivaVerizonMedia
let connector = ConvivaConnectorVerizonMedia(
configuration: configuration,
player: yourTHEOplayer
)
Set report the viewer's ID:
connector.report(viewerID: "John Doe")
For each asset that you play, set it's name using:
connector.report(assetName: "Star Wars episode II")
Hold a reference to your connector. Once the connector is released from memory it will clean up itself and stop reporting to Conviva.