Chris
Chris

Reputation: 8020

Using Firebase with tvOS

When I try to use the Firebase framework with tvOS (via cocoapods) I get the following error:

Target 'Pods-Portal TV' of project 'Pods' was rejected as an implicit dependency for 'Pods_Portal_TV.framework' because it doesn't contain platform 'appletvsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator, iphoneos'

I 'tricked' cocoapods to install the framework due to it not recognizing tvOS as a supported platform, by declaring the target as :ios.

So it's easy to see what the problem is. My question: Is it possible to work around this until Firebase officially supports tvOS?

Upvotes: 10

Views: 7790

Answers (3)

Mike McDonald
Mike McDonald

Reputation: 15963

EDIT (8/5/17): tvOS support is being added to the open source Firebase SDK in issue #10. Please follow along there and contribute!

Firebase developer here.

I've built a beta version of the Firebase framework for tvOS, and I'm happy to share with folks so they can give feedback. Please email me at mcdonald firebase com for access.

EDIT (7/28/16): Given the date on this post and the huge Firebase release at Google I/O 2016, there are a few extra caveats I should add to what this library does.

  • This is a version of the 2.x client and will work with the database on all projects. Authentication however, will not work with projects created after 5/18/2016.
  • This client is not compatible with Nest, as Nest only supports the 1.x Firebase clients.

EDIT (8/27/16): Please fill out this form to let us know you'd like support for Firebase on other platforms (macOS, tvOS, watchOS).

EDIT (10/29/21): Firebase 8.9.0 introduces official beta support for macOS, tvOS, and Catalyst. watchOS continues to be community supported.

Upvotes: 15

Jonny
Jonny

Reputation: 16308

Getting some progress from the open source community lately, I just got auth/database working after one or two hours, mostly fighting with the podfile. Seems to work, check out https://github.com/firebase/firebase-ios-sdk#community-supported-efforts

Upvotes: 3

Chris
Chris

Reputation: 8020

Ok, so I got it working, albeit, a bit flaky.

This is a very quick guide as to how, at the time of writing.

First you need to setup CocoaPods to use unreleased features and get the master branch of cocoapods / cocoapods-core

Then you need to create a private spec repo or use mine

Remember to set your xcode path to your beta version of xcode sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer otherwise the spec won't build.

Then set your source to your spec file, and set the platform to platform :tvos, '9.0' in your Podfile, then pod install.

Your Project should then build and run, but with about 155 warnings:

ld: warning: URGENT: building for tvOS simulator, but linking in object file (/Users/..../..../.... /tvOS/Pods/Firebase/Firebase.framework/Firebase(FPendingPut.o)) built for iOS. Note: This will be an error in the future.

So obviously not a solid solution. Definately not a production solution. But hopefully Firebase will add support in the future. I spoke to Frank from the Firebase team who said that he will take it up at the next feature discussion to see if they want to include it. Here's to hoping they will :)

Also, I had to Comment out the Accounts/Accounts.h import statement in the FAuthData.h for some reason? I don't know if anyone can elaborate on that

Upvotes: 9

Related Questions