Use iPhone as a game controller in a tvOS app?

During the Apple TV announcement, the developers of Crossy Road demonstrated using an iPhone as a 2nd controller for an Apple tv game:


http://www.macrumors.com/2015/09/09/cooperative-play-for-crossy-road/


My first thought was to implement this using the Multipeer Connectivity Framework. However, this framework is not supported on tvOS. Is there a good way to connect an iPhone to an Apple TV without Multipeer Connectivity?

Accepted Reply

Hi Aaron - You could look at options such as Bonjour discovery on the local network, or perhaps use CoreBluetooth to make use of Bluetooth LE.

Replies

Hi Aaron - You could look at options such as Bonjour discovery on the local network, or perhaps use CoreBluetooth to make use of Bluetooth LE.

Is Bonjour or CB really the accepted solution for this widely advertised use case? Is there a way to use GameCenter to connect both the tvOS app and the iPhone app?

With the previous generations of Apple TV you can use an iOS device with the Apple Remote App. But the question is if Apple will update the app so it will work with the new Apple TV. And in this case, would it be possible to use this as 2nd control in a game?


To implement a two player game, you can require the user to buy a 2nd remote. But as a developer, it is not yet possible to get hold of another remote to start developing. And I'm not sure it is a wise thing to require players to have to buy more touchpad remotes.


The Multipeer Connectivity framework is not supported by tvOS. Game Center peer-to-peer technology is not supported by tvOS.


The last option is to develop your own remote-app for iOS devices, that will connect to your tvOS app through CoreBluetooth or Bonjour network. This require some work, and the App Store will be filled with different remote-apps for different tvOS games.

I totally agree. Please upvote here to add support for Multipeer Connectivity Framework: https://forums.developer.apple.com/thread/25049

Also it helps if you file a issue asking the feature request, there are several duplicates about Multipeer Connectivity on tvOS, and I have been in touch with Game and ATV evangelists that knows the problem, they assure it's on the roadmap, but having more rumors on forums / issue will help a lot, to put it on top of the priorities!

I created a framework that provides a wrapper around GCController designed to support software-based controllers that communicate with your game using NSNetservice, and update through the MFi profiles. NSNetservice allowed me to support iOS, tvOS and OS X. I also support watchOS, but using Watch Connectivity for that.


https://github.com/robreuss/VirtualGameController

Rob's work is awesome! Definitely worth checking out!