Open mhdhejazi opened 4 years ago
Extensions are not officially supported, but some Firebase SDKs do work in extensions. In this case it's fine to use the main GoogleService-Info.plist file in the extension.
Does the error make sense though?
I mean what's the cause of the bundle id inconsistency here? And why does it accept the main GoogleService-Info.plist
that contains the main app id?
Does Firebase check the current bundle id or the root bundle's one?
I think this is a bit confusing and deserves a note in the documentation.
P.S. I needed to create a different app in my Firebase project with the bundle id of the extension for Crashlytics to work. This makes things more confusing now. Crashlytics needs a different app in Firebase but I should not use its GoogleService-Info.plist
?
Hm, that's definitely not good. Some background: The first warning message you got was from Analytics, which will discard some early lifecycle logs if the GoogleService-Info.plist has a mismatched bundle ID but otherwise work fine. Crashlytics is more restrictive, since it uses the bundle id to uniquely identify your binary. Since your extension is a separate process from your main app, you'll most likely need to use a separate GoogleService-Info.plist and just ignore the Analytics warning log.
We'll look into ways to make this experience better.
This error is still happening. It's confusing to the user and it should be resolved. Many apps use app extensions and need crash reporting for them.
Also, I can't verify my app extension because of this issue. Everything is setup correctly (two apps in same project, two files, each with their respective target), but this error is stopping the verification.
We'll look into ways to make this experience better.
Any progress on this front?
No. This is a lower priority for us than macOS native and Catalyst support.
@morganchen12 thanks for the update! Is there anywhere for us to know which Firebase SDKs will work and which won't?
For example, after a bit of work I have Analytics working (minus a few issues), but I don't have Crashlytics working. Would be great to know if this can work in iMessage Extensions or not before I pour the time in.
Thanks in advance!
We don't have a matrix of which platforms are supported by which Firebase components. Crashlytics will probably work if you can set up the extension as a separate app and convince Crashlytics it's just reporting another app's crashes.
With this year's WWDC adding even more emphasis on non-app targets in the Apple ecosystem, we've increased the pressure internally to provide first-class support for non-app Apple platforms targets, but I don't have any concrete news or timelines to share.
@jeffreyrobert do you mind sharing how you were able to get Analytics working for your extension? I set up my app with two Info plist files like the original post, but no analytics were being reported.
@tehsven sorry for the delay. Hope you were able to get it working, if not (and for others). This is my current setup.
It seems that the Firebase team has made a lot of improvements this year (2020) in regards to Extension support for their SDKs. I updated to the latest SDKs and everything worked pretty smoothly for me. Here's my setup:
Bundle ID
I believe the recommended setup is to use your Main App Target's bundle ID for your Firebase app. So do not include the .MessagesExtension
.
I set my app up before this was possible, so my Firebase app is using my iMessage Extension Target's bundle ID including .MessagesExtension
. This may give me issues down the line but I don't actually have a Main App, my app is a standalone iMessage Extension.
Initialization
override func willBecomeActive(with conversation: MSConversation) {
// need to do this check to handle instances of application running in transcript view
// note this check will cause this log:
// [Firebase/Core][I-COR000005] No app has been configured yet.
if let firebaseApps = FirebaseApp.allApps,
!firebaseApps.isEmpty {
// already configured
} else {
FirebaseApp.configure()
}
Versions
I'm trying to add Firebase to an iMessage app extension. I created a project in Firebase and added two iOS apps, one for the main app (id:
com.company.app
), and the other for the extension (id:com.company.app.stickers
). I followed the guides and added the properGoogleService-Info.plist
file to each target. But when I run the extension I see error this in Xcode output:I made sure the bundle identifier of the extension is actually
com.company.app.stickers
. But the interesting thing is that when I tried to use the mainGoogleService-Info.plist
for the extension target the error disappeared although the bundle id in this plist file iscom.company.app
and the bundle id of the extension target is different!So, am I doing anything wrong here? Or iOS extensions are not supported?