Spotify Apple TV 4th gen Application

Many, many users are requesting an Spotify Apple TV 4th gen Application. I’m an active Apple TV user and I really missed it as well. So, as an iOS developer I decided to build it myself.

It wasn’t as easy as I hoped before I started this project. I created the Apple TV application itself quite fast, but I had two major barriers to resolve.

Authenticating on an Apple TV without UIWebViews

As we all know, the Apple TV doesn’t official support UIWebViews (unofficially, it does). I had to create a client application for the iPhone and iPad which could communicate with the Apple TV. These were my options:

  • Multipeer Connectivity. Not supported on tvOS (yet, tvOS 10 will!)
  • Sockets. Didn’t feel like the best options to use
  • Bonjour. Exactly what I was looking for!

A small research on Github gave me this library called Voucher. It made it quite easy to implement the authentication flow:

Spotify Apple TV Authentication Client

Spotify Apple TV Authentication Client

Building the Spotify iOS SDK for the Apple TV architecture

At the end I had a working version of the Spotify Apple TV application I build. However, I didn’t try it on a real device or uploaded a binary to iTunes Connect. The moment I started doing that, I encountered a new problem:

Spotify-iOS-SDK/libSpotify.a(SPTAudioStreamingController.o), building for tvOS, but linking in object file built for iOS, for architecture arm64

No way to fix this, I had to wait just like all the others.

Releasing an Spotify Apple TV 4th gen Application

However, I’ll be ready to implement this new version of the SDK and upload the app as soon as possible. Be prepared!