Kraken Data was approached by a client to provide a plan for integrating Webtrends Analytics into an Apple TV application.
This appeared to be a simple request given our experience integrating with iOS and Android apps. Having never developed an Apple TV app before our first step was to build a basic tvOS application to understand how all the screens and actions are handled, and then tried to incorporate the Webtrends iOS SDK. And this is when things started to get interesting.What we found out was:
- Most code examples for tvOS are in Swift and we have mostly coded in Objective C.
- The Webtrends SDK was not able to be installed within a tvOS App.
Now that we knew the challenges it was time to put together a solution. Learning Swift has been on the agenda for a while so this would be a good opportunity to do that. Webtrends have an API which will allow us to POST events back to their servers, so we will try and use that.
Now all our client needs to do is:
- Add their Webtrends client DCS ID to their apps plist file.
- Include our Webtrends Analytics functions Swift file into their project.
- Call the function wt_postEvents() or wt_postEventsJS() with any parameters which require passing through to Webtrends.